use of org.nd4j.imports.descriptors.properties.PropertyMapping in project nd4j by deeplearning4j.
the class SpaceToDepth method mappingsForFunction.
@Override
public Map<String, Map<String, PropertyMapping>> mappingsForFunction() {
Map<String, Map<String, PropertyMapping>> ret = new HashMap<>();
Map<String, PropertyMapping> attrs = new LinkedHashMap<>();
val blockSize = PropertyMapping.builder().tfAttrName("block_size").propertyNames(new String[] { "blockSize" }).build();
attrs.put("blockSize", blockSize);
val dataFormatMapping = PropertyMapping.builder().tfAttrName("data_format").propertyNames(new String[] { "dataFormat" }).build();
attrs.put("dataFormat", dataFormatMapping);
ret.put(tensorflowName(), attrs);
return ret;
}
use of org.nd4j.imports.descriptors.properties.PropertyMapping in project nd4j by deeplearning4j.
the class Conv1D method mappingsForFunction.
@Override
public Map<String, Map<String, PropertyMapping>> mappingsForFunction() {
Map<String, Map<String, PropertyMapping>> ret = new HashMap<>();
Map<String, PropertyMapping> map = new HashMap<>();
val strideMapping = PropertyMapping.builder().tfAttrName("strides").onnxAttrName("strides").propertyNames(new String[] { "s" }).build();
val kernelMapping = PropertyMapping.builder().propertyNames(new String[] { "k" }).tfInputPosition(1).shapePosition(0).onnxAttrName("kernel_shape").build();
val paddingMapping = PropertyMapping.builder().onnxAttrName("padding").propertyNames(new String[] { "p" }).build();
val dataFormat = PropertyMapping.builder().onnxAttrName("data_format").tfAttrName("data_format").propertyNames(new String[] { "dataFormat" }).build();
val nhwc = PropertyMapping.builder().onnxAttrName("data_format").tfAttrName("data_format").propertyNames(new String[] { "isNHWC" }).build();
val sameMode = PropertyMapping.builder().onnxAttrName("auto_pad").propertyNames(new String[] { "isSameMode" }).tfAttrName("padding").build();
map.put("s", strideMapping);
map.put("k", kernelMapping);
map.put("p", paddingMapping);
map.put("isSameMode", sameMode);
map.put("dataFormat", dataFormat);
map.put("isNHWC", nhwc);
try {
ret.put(onnxName(), map);
} catch (NoOpNameFoundException e) {
// ignore
}
try {
ret.put(tensorflowName(), map);
} catch (NoOpNameFoundException e) {
// ignore
}
return ret;
}
use of org.nd4j.imports.descriptors.properties.PropertyMapping in project nd4j by deeplearning4j.
the class CumSum method mappingsForFunction.
@Override
public Map<String, Map<String, PropertyMapping>> mappingsForFunction() {
Map<String, Map<String, PropertyMapping>> ret = new HashMap<>();
Map<String, PropertyMapping> map = new HashMap<>();
val exclusiveMapper = PropertyMapping.builder().tfAttrName("exclusive").propertyNames(new String[] { "exclusive" }).build();
val reverseMapper = PropertyMapping.builder().tfAttrName("reverse").propertyNames(new String[] { "reverse" }).build();
map.put("exclusive", exclusiveMapper);
map.put("reverse", reverseMapper);
ret.put(tensorflowName(), map);
return ret;
}
use of org.nd4j.imports.descriptors.properties.PropertyMapping in project nd4j by deeplearning4j.
the class Mmul method mappingsForFunction.
@Override
public Map<String, Map<String, PropertyMapping>> mappingsForFunction() {
Map<String, Map<String, PropertyMapping>> ret = new HashMap<>();
Map<String, PropertyMapping> map = new HashMap<>();
val transposeA = PropertyMapping.builder().onnxAttrName("transA").tfAttrName("transpose_a").propertyNames(new String[] { "transposeA" }).build();
val transposeB = PropertyMapping.builder().onnxAttrName("transB").tfAttrName("transpose_b").propertyNames(new String[] { "transposeB" }).build();
map.put("transposeA", transposeA);
map.put("transposeB", transposeB);
ret.put(tensorflowName(), map);
ret.put(onnxName(), map);
return ret;
}
use of org.nd4j.imports.descriptors.properties.PropertyMapping in project nd4j by deeplearning4j.
the class Slice method mappingsForFunction.
@Override
public Map<String, Map<String, PropertyMapping>> mappingsForFunction() {
Map<String, Map<String, PropertyMapping>> ret = new HashMap<>();
Map<String, PropertyMapping> map = new HashMap<>();
val beginMapping = PropertyMapping.builder().tfInputPosition(1).propertyNames(new String[] { "begin" }).build();
val size = PropertyMapping.builder().tfInputPosition(2).propertyNames(new String[] { "size" }).build();
map.put("begin", beginMapping);
map.put("size", size);
ret.put(tensorflowName(), map);
return ret;
}
Aggregations