public class Switch extends BaseCompatOp
DynamicCustomOp.DynamicCustomOpsBuilder| Modifier and Type | Field and Description |
|---|---|
static String |
OP_NAME
WARNING: do not change without changing serialization methods
See
org.nd4j.autodiff.samediff.serde.FlatBuffersMapper#getOpNum(String, Type)
and DifferentialFunctionClassHolder.customOpClassForHashAndName(long, String) |
static int |
OP_NUM |
frameNameaxis, bArguments, dArguments, iArguments, inplaceCall, inputArguments, outputArguments, outputVariables, sArguments, tArgumentsdimensions, extraArgs, inPlace, ownName, ownNameSetWithDefault, sameDiff, scalarValue| Constructor and Description |
|---|
Switch() |
Switch(INDArray input,
INDArray predicate) |
Switch(SameDiff sameDiff,
SDVariable input,
SDVariable predicate) |
| Modifier and Type | Method and Description |
|---|---|
List<DataType> |
calculateOutputDataTypes(List<DataType> inputDataTypes)
Calculate the data types for the output arrays.
|
void |
configureFromArguments()
This allows a custom op to configure relevant fields from its arguments.
|
void |
configureWithSameDiff(SameDiff sameDiff) |
int |
getNumOutputs() |
void |
initFromTensorFlow(NodeDef nodeDef,
SameDiff initWith,
Map<String,AttrValue> attributesForNode,
GraphDef graph)
Initialize the function from the given
NodeDef |
String |
opName()
This method returns op opName as string
|
Op.Type |
opType()
The type of the op
|
SDVariable[] |
outputVariables()
Return the output variables for this differential function.
|
void |
setPropertiesForFunction(Map<String,Object> properties) |
String |
tensorflowName()
The opName of this function tensorflow
|
addSArgument, attributeAdaptersForFunction, calculateOutputShape, computeArrays, getFrameName, mappingsForFunction, propertiesForFunction, setFrameNameaddBArgument, addDArgument, addIArgument, addIArgument, addInputArgument, addOutputArgument, addTArgument, assertValidForExecution, bArgs, builder, calculateOutputShape, clearArrays, dArgs, doDiff, generateFake, generateFake, getBArgument, getDescriptor, getIArgument, getInputArgument, getOutputArgument, getSArgument, getTArgument, getValue, iArgs, initFromOnnx, inputArguments, numBArguments, numDArguments, numIArguments, numInputArguments, numOutputArguments, numSArguments, numTArguments, onnxName, opHash, opNum, outputArguments, outputVariables, removeIArgument, removeInputArgument, removeOutputArgument, removeSArgument, removeTArgument, sArgs, setInputArgument, setInputArguments, setOutputArgument, setValueFor, tArgs, toString, wrapFilterNull, wrapOrNull, wrapOrNullarg, arg, argNames, args, configFieldName, diff, dup, equals, getBooleanFromProperty, getDoubleValueFromProperty, getIntValueFromProperty, getLongValueFromProperty, getStringFromProperty, hashCode, isConfigProperties, larg, onnxNames, outputs, outputVariable, outputVariablesNames, rarg, replaceArg, setInstanceId, tensorflowNamesclone, finalize, getClass, notify, notifyAll, wait, wait, waitisInplaceCallpublic static final String OP_NAME
org.nd4j.autodiff.samediff.serde.FlatBuffersMapper#getOpNum(String, Type)
and DifferentialFunctionClassHolder.customOpClassForHashAndName(long, String)public static final int OP_NUM
public Switch(SameDiff sameDiff, SDVariable input, SDVariable predicate)
public Switch()
public String opName()
DynamicCustomOpopName in interface CustomOpopName in class DynamicCustomOppublic SDVariable[] outputVariables()
DifferentialFunctionoutputVariables in class DynamicCustomOppublic String tensorflowName()
DifferentialFunctiontensorflowName in class DynamicCustomOppublic Op.Type opType()
DifferentialFunctionopType in class DynamicCustomOppublic void initFromTensorFlow(NodeDef nodeDef, SameDiff initWith, Map<String,AttrValue> attributesForNode, GraphDef graph)
DifferentialFunctionNodeDefinitFromTensorFlow in class BaseCompatOppublic void configureFromArguments()
CustomOpconfigureFromArguments in interface CustomOpconfigureFromArguments in class BaseCompatOppublic void setPropertiesForFunction(Map<String,Object> properties)
setPropertiesForFunction in class BaseCompatOppublic void configureWithSameDiff(SameDiff sameDiff)
configureWithSameDiff in class BaseCompatOppublic int getNumOutputs()
getNumOutputs in class DifferentialFunctionpublic List<DataType> calculateOutputDataTypes(List<DataType> inputDataTypes)
DifferentialFunctionDifferentialFunction.calculateOutputShape(), this method differs in that it does not
require the input arrays to be populated.
This is important as it allows us to do greedy datatype inference for the entire net - even if arrays are not
available.calculateOutputDataTypes in class DifferentialFunctioninputDataTypes - The data types of the inputsCopyright © 2022. All rights reserved.