GRAPH_TYPE
- the type of graphNODE_TYPE
- the type of nodeATTR_TYPE
- the attribute typepublic abstract class BaseGraphMapper<GRAPH_TYPE,NODE_TYPE,ATTR_TYPE,TENSOR_TYPE> extends Object implements GraphMapper<GRAPH_TYPE,NODE_TYPE,ATTR_TYPE,TENSOR_TYPE>
Constructor and Description |
---|
BaseGraphMapper() |
Modifier and Type | Method and Description |
---|---|
SameDiff |
importGraph(File graphFile)
Import a graph as same diff
from the given file
|
SameDiff |
importGraph(GRAPH_TYPE tfGraph)
This method converts given TF
|
SameDiff |
importGraph(InputStream inputStream)
Import a graph as same diff
from the given file
|
void |
mapProperties(DifferentialFunction on,
NODE_TYPE node,
GRAPH_TYPE graph,
SameDiff sameDiff,
Map<String,Map<String,PropertyMapping>> propertyMappings) |
Map<String,NODE_TYPE> |
nameIndexForGraph(GRAPH_TYPE graph) |
Map<String,NODE_TYPE> |
nodesByName(GRAPH_TYPE graph)
Get the nodes sorted by n ame
from a given graph
|
Op.Type |
opTypeForNode(NODE_TYPE nodeDef)
Returns an op type for the given input node
|
protected GRAPH_TYPE |
readGraph(InputStream inputStream) |
boolean |
validTensorDataType(TENSOR_TYPE tensorType)
Whether the data type for the tensor is valid
for creating an
INDArray |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
alreadySeen, dataTypeForTensor, dumpBinaryProtoAsText, dumpBinaryProtoAsText, getArrayFrom, getAttrMap, getAttrValueFromNode, getInputFromNode, getMappedOp, getName, getNDArrayFromTensor, getNewGraphBuilder, getNodeList, getNodeWithNameFromGraph, getOpType, getShape, getShapeFromAttr, getShapeFromAttribute, getShapeFromTensor, getTargetMappingForOp, hasShape, isOpIgnoreException, isPlaceHolder, isPlaceHolderNode, isVariableNode, mapNodeType, mapProperty, numInputsFor, opsToIgnore, parseGraphFrom, parseGraphFrom, shouldSkip, translateToSameDiffName, variablesForGraph
public Op.Type opTypeForNode(NODE_TYPE nodeDef)
GraphMapper
opTypeForNode
in interface GraphMapper<GRAPH_TYPE,NODE_TYPE,ATTR_TYPE,TENSOR_TYPE>
nodeDef
- the node to usepublic void mapProperties(DifferentialFunction on, NODE_TYPE node, GRAPH_TYPE graph, SameDiff sameDiff, Map<String,Map<String,PropertyMapping>> propertyMappings)
mapProperties
in interface GraphMapper<GRAPH_TYPE,NODE_TYPE,ATTR_TYPE,TENSOR_TYPE>
public SameDiff importGraph(InputStream inputStream)
GraphMapper
importGraph
in interface GraphMapper<GRAPH_TYPE,NODE_TYPE,ATTR_TYPE,TENSOR_TYPE>
inputStream
- protected GRAPH_TYPE readGraph(InputStream inputStream)
public SameDiff importGraph(File graphFile)
GraphMapper
importGraph
in interface GraphMapper<GRAPH_TYPE,NODE_TYPE,ATTR_TYPE,TENSOR_TYPE>
graphFile
- public Map<String,NODE_TYPE> nameIndexForGraph(GRAPH_TYPE graph)
nameIndexForGraph
in interface GraphMapper<GRAPH_TYPE,NODE_TYPE,ATTR_TYPE,TENSOR_TYPE>
public Map<String,NODE_TYPE> nodesByName(GRAPH_TYPE graph)
GraphMapper
nodesByName
in interface GraphMapper<GRAPH_TYPE,NODE_TYPE,ATTR_TYPE,TENSOR_TYPE>
graph
- the graph to get the nodes forpublic SameDiff importGraph(GRAPH_TYPE tfGraph)
importGraph
in interface GraphMapper<GRAPH_TYPE,NODE_TYPE,ATTR_TYPE,TENSOR_TYPE>
tfGraph
- public boolean validTensorDataType(TENSOR_TYPE tensorType)
GraphMapper
INDArray
validTensorDataType
in interface GraphMapper<GRAPH_TYPE,NODE_TYPE,ATTR_TYPE,TENSOR_TYPE>
tensorType
- the tensor proto to testCopyright © 2018. All rights reserved.