當前位置: 首頁>>代碼示例>>Java>>正文


Java YAMLFactory類代碼示例

本文整理匯總了Java中org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory的典型用法代碼示例。如果您正苦於以下問題:Java YAMLFactory類的具體用法?Java YAMLFactory怎麽用?Java YAMLFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


YAMLFactory類屬於org.nd4j.shade.jackson.dataformat.yaml包,在下文中一共展示了YAMLFactory類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testReadingYaml

import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
@Test
public void testReadingYaml() throws Exception {
    //Exact same information as JSON format, but in YAML format

    ClassPathResource cpr = new ClassPathResource("yaml/yaml_test_0.txt");
    String path = cpr.getFile().getAbsolutePath().replace("0", "%d");

    InputSplit is = new NumberedFileInputSplit(path, 0, 2);

    RecordReader rr = new JacksonRecordReader(getFieldSelection(), new ObjectMapper(new YAMLFactory()));
    rr.initialize(is);

    testJacksonRecordReader(rr);
}
 
開發者ID:deeplearning4j,項目名稱:DataVec,代碼行數:15,代碼來源:JacksonRecordReaderTest.java

示例2: initMapperYaml

import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
private static ObjectMapper initMapperYaml() {
    return initMapper(new YAMLFactory());
}
 
開發者ID:deeplearning4j,項目名稱:DataVec,代碼行數:4,代碼來源:ImageTransformProcess.java

示例3: getMapper

import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
private ObjectMapper getMapper() {
    return getObjectMapper(new YAMLFactory());
}
 
開發者ID:deeplearning4j,項目名稱:DataVec,代碼行數:4,代碼來源:YamlSerializer.java

示例4: initMapperYaml

import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
private static ObjectMapper initMapperYaml() {
    ObjectMapper ret = new ObjectMapper(new YAMLFactory());
    configureMapper(ret);
    return ret;
}
 
開發者ID:deeplearning4j,項目名稱:deeplearning4j,代碼行數:6,代碼來源:NeuralNetConfiguration.java

示例5: getYamlMapper

import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
protected static synchronized ObjectMapper getYamlMapper() {
    if (yamlMapper == null) {
        yamlMapper = getNewMapper(new YAMLFactory());
    }
    return yamlMapper;
}
 
開發者ID:deeplearning4j,項目名稱:deeplearning4j,代碼行數:7,代碼來源:BaseTrainingMaster.java

示例6: parseYamlString

import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
/**
 * Convenience function for parsing YAML strings.
 *
 * @param yaml String containing valid YAML
 * @return Nested (key,value) map of arbitrary depth
 * @throws IOException
 */
public static Map<String, Object> parseYamlString(String yaml) throws IOException {
    ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
    TypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<String, Object>>() {
    };
    return mapper.readValue(yaml, typeRef);
}
 
開發者ID:deeplearning4j,項目名稱:deeplearning4j,代碼行數:14,代碼來源:KerasModelUtils.java

示例7: toYaml

import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
/**
 * Serialize this schema to yaml
 * @return the yaml representation of this schema
 */
public String toYaml() {
    return toJacksonString(new YAMLFactory());
}
 
開發者ID:deeplearning4j,項目名稱:DataVec,代碼行數:8,代碼來源:Schema.java

示例8: fromYaml

import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
/**
 * Create a schema from the given
 * yaml string
 * @param yaml the yaml to create the schema from
 * @return the created schema based on the yaml
 */
public static Schema fromYaml(String yaml) {
    return fromJacksonString(yaml, new YAMLFactory());
}
 
開發者ID:deeplearning4j,項目名稱:DataVec,代碼行數:10,代碼來源:Schema.java

示例9: findTypesFor

import org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory; //導入依賴的package包/類
/**
 *
 * @param types
 * @param json
 * @return
 */
public static ObjectMapper findTypesFor(List<Class<?>> types, boolean json) {
    return withTypes(json ? new ObjectMapper() : new ObjectMapper(new YAMLFactory()), getImpls(types));

}
 
開發者ID:deeplearning4j,項目名稱:nd4j,代碼行數:11,代碼來源:JacksonReflectionLoader.java


注:本文中的org.nd4j.shade.jackson.dataformat.yaml.YAMLFactory類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。