Class BaseTensorOp
- java.lang.Object
-
- org.nd4j.autodiff.functions.DifferentialFunction
-
- org.nd4j.linalg.api.ops.DynamicCustomOp
-
- org.nd4j.linalg.api.ops.impl.shape.tensorops.BaseTensorOp
-
- All Implemented Interfaces:
CustomOp
- Direct Known Subclasses:
TensorArray
,TensorArrayConcat
,TensorArrayGather
,TensorArrayRead
,TensorArrayRemove
,TensorArrayScatter
,TensorArraySize
,TensorArraySplit
,TensorArrayWrite
public abstract class BaseTensorOp extends DynamicCustomOp
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.nd4j.linalg.api.ops.DynamicCustomOp
DynamicCustomOp.DynamicCustomOpsBuilder
-
-
Field Summary
-
Fields inherited from class org.nd4j.linalg.api.ops.DynamicCustomOp
axis, bArguments, dArguments, iArguments, inplaceCall, inputArguments, outputArguments, outputVariables, sArguments, tArguments
-
Fields inherited from class org.nd4j.autodiff.functions.DifferentialFunction
dimensions, extraArgs, inPlace, ownName, ownNameSetWithDefault, sameDiff, scalarValue
-
-
Constructor Summary
Constructors Constructor Description BaseTensorOp()
BaseTensorOp(String name, SameDiff sameDiff, SDVariable[] args)
BaseTensorOp(SameDiff sameDiff, SDVariable[] args)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<LongShapeDescriptor>
calculateOutputShape()
Calculate the output shape for this opvoid
computeArrays()
List<SDVariable>
doDiff(List<SDVariable> f1)
The actual implementation for automatic differentiation.int
getNumOutputs()
void
initFromTensorFlow(NodeDef nodeDef, SameDiff initWith, Map<String,AttrValue> attributesForNode, GraphDef graph)
Initialize the function from the givenNodeDef
String
onnxName()
The opName of this function in onnxOp.Type
opType()
The type of the opString
toString()
-
Methods inherited from class org.nd4j.linalg.api.ops.DynamicCustomOp
addBArgument, addDArgument, addIArgument, addIArgument, addInputArgument, addOutputArgument, addOutputsToOp, addSArgument, addTArgument, assertValidForExecution, bArgs, builder, calculateOutputShape, clearArrays, configureFromArguments, dArgs, generateFake, generateFake, getBArgument, getDescriptor, getIArgument, getInputArgument, getOutputArgument, getSArgument, getTArgument, getValue, iArgs, initFromOnnx, inputArguments, mappingsForFunction, numBArguments, numDArguments, numIArguments, numInputArguments, numOutputArguments, numSArguments, numTArguments, opHash, opName, opNum, outputArguments, outputVariables, outputVariables, propertiesForFunction, removeIArgument, removeInputArgument, removeOutputArgument, removeSArgument, removeTArgument, sArgs, setInputArgument, setInputArguments, setOutputArgument, setPropertiesForFunction, setValueFor, tArgs, tensorflowName, wrapFilterNull, wrapOrNull, wrapOrNull
-
Methods inherited from class org.nd4j.autodiff.functions.DifferentialFunction
arg, arg, argNames, args, attributeAdaptersForFunction, calculateOutputDataTypes, configFieldName, configureWithSameDiff, diff, dup, equals, getBooleanFromProperty, getDoubleValueFromProperty, getIntValueFromProperty, getLongValueFromProperty, getStringFromProperty, hashCode, isConfigProperties, larg, onnxNames, outputs, outputVariable, outputVariablesNames, rarg, replaceArg, setInstanceId, tensorflowNames
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.nd4j.linalg.api.ops.CustomOp
isInplaceCall
-
-
-
-
Constructor Detail
-
BaseTensorOp
public BaseTensorOp(String name, SameDiff sameDiff, SDVariable[] args)
-
BaseTensorOp
public BaseTensorOp(SameDiff sameDiff, SDVariable[] args)
-
BaseTensorOp
public BaseTensorOp()
-
-
Method Detail
-
initFromTensorFlow
public void initFromTensorFlow(NodeDef nodeDef, SameDiff initWith, Map<String,AttrValue> attributesForNode, GraphDef graph)
Description copied from class:DifferentialFunction
Initialize the function from the givenNodeDef
- Overrides:
initFromTensorFlow
in classDynamicCustomOp
-
doDiff
public List<SDVariable> doDiff(List<SDVariable> f1)
Description copied from class:DifferentialFunction
The actual implementation for automatic differentiation.- Overrides:
doDiff
in classDynamicCustomOp
- Returns:
-
opType
public Op.Type opType()
Description copied from class:DifferentialFunction
The type of the op- Overrides:
opType
in classDynamicCustomOp
- Returns:
-
onnxName
public String onnxName()
Description copied from class:DifferentialFunction
The opName of this function in onnx- Overrides:
onnxName
in classDynamicCustomOp
- Returns:
-
toString
public String toString()
- Overrides:
toString
in classDynamicCustomOp
-
calculateOutputShape
public List<LongShapeDescriptor> calculateOutputShape()
Description copied from class:DifferentialFunction
Calculate the output shape for this op- Specified by:
calculateOutputShape
in interfaceCustomOp
- Overrides:
calculateOutputShape
in classDynamicCustomOp
- Returns:
- List of output shape descriptors
-
computeArrays
public void computeArrays()
- Overrides:
computeArrays
in classDynamicCustomOp
-
getNumOutputs
public int getNumOutputs()
- Overrides:
getNumOutputs
in classDifferentialFunction
-
-