Package org.nd4j.linalg.api.ops
Class BaseTransformStrictOp
- java.lang.Object
-
- org.nd4j.autodiff.functions.DifferentialFunction
-
- org.nd4j.linalg.api.ops.BaseOp
-
- org.nd4j.linalg.api.ops.BaseTransformOp
-
- org.nd4j.linalg.api.ops.BaseTransformStrictOp
-
- All Implemented Interfaces:
Op
,TransformOp
,TransformStrictOp
- Direct Known Subclasses:
ACos
,ACosh
,ASin
,ASinh
,ATan
,ATanh
,Cos
,Cosh
,CubeDerivative
,Erf
,Erfc
,Exp
,Expm1
,GELU
,GELUDerivative
,HardSigmoid
,HardSigmoidDerivative
,HardTanh
,HardTanhDerivative
,Log
,Log1p
,LogSigmoid
,Mish
,MishDerivative
,PreciseGELU
,PreciseGELUDerivative
,RationalTanh
,RationalTanhDerivative
,RectifiedTanh
,RectifiedTanhDerivative
,Rint
,SELU
,SELUDerivative
,SetRange
,Sigmoid
,SigmoidDerivative
,Sin
,Sinh
,SoftPlus
,SoftSign
,SoftSignDerivative
,Stabilize
,Swish
,SwishDerivative
,Tan
,TanDerivative
,Tanh
,TanhDerivative
public abstract class BaseTransformStrictOp extends BaseTransformOp implements TransformStrictOp
-
-
Field Summary
-
Fields inherited from class org.nd4j.linalg.api.ops.BaseOp
dimensionz, extraArgz, x, xVertexId, y, yVertexId, z, zVertexId
-
Fields inherited from class org.nd4j.autodiff.functions.DifferentialFunction
dimensions, extraArgs, inPlace, ownName, ownNameSetWithDefault, sameDiff, scalarValue
-
-
Constructor Summary
Constructors Constructor Description BaseTransformStrictOp()
BaseTransformStrictOp(SameDiff sameDiff, SDVariable i_v, boolean inPlace)
BaseTransformStrictOp(SameDiff sameDiff, SDVariable i_v, long[] shape, boolean inPlace, Object[] extraArgs)
BaseTransformStrictOp(SameDiff sameDiff, SDVariable i_v, Object[] extraArgs)
BaseTransformStrictOp(SameDiff sameDiff, SDVariable i_v1, SDVariable i_v2)
BaseTransformStrictOp(SameDiff sameDiff, SDVariable i_v1, SDVariable i_v2, boolean inPlace)
BaseTransformStrictOp(INDArray x)
BaseTransformStrictOp(INDArray x, INDArray z)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<DataType>
calculateOutputDataTypes(List<DataType> dataTypes)
Calculate the data types for the output arrays.List<LongShapeDescriptor>
calculateOutputShape()
Calculate the output shape for this opList<LongShapeDescriptor>
calculateOutputShape(OpContext oc)
Op.Type
getOpType()
Op.Type
opType()
The type of the opDataType
resultType()
This method returns datatype for result array wrt given inputsDataType
resultType(OpContext opContext)
boolean
validateDataTypes(OpContext oc, boolean experimentalMode)
-
Methods inherited from class org.nd4j.linalg.api.ops.BaseTransformOp
z
-
Methods inherited from class org.nd4j.linalg.api.ops.BaseOp
clearArrays, computeVariables, defineDimensions, dimensions, equals, extraArgs, extraArgsBuff, extraArgsDataBuff, getFinalResult, getInputArgument, getNumOutputs, getOpType, hashCode, initFromOnnx, initFromTensorFlow, onnxName, outputVariables, setX, setY, setZ, tensorflowName, toCustomOp, toString, x, y
-
Methods inherited from class org.nd4j.autodiff.functions.DifferentialFunction
arg, arg, argNames, args, attributeAdaptersForFunction, configFieldName, configureWithSameDiff, diff, doDiff, dup, getBooleanFromProperty, getDoubleValueFromProperty, getIntValueFromProperty, getLongValueFromProperty, getStringFromProperty, getValue, isConfigProperties, larg, mappingsForFunction, onnxNames, opName, opNum, outputs, outputVariable, outputVariables, outputVariablesNames, propertiesForFunction, rarg, replaceArg, setInstanceId, setPropertiesForFunction, setValueFor, 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.Op
clearArrays, extraArgs, extraArgsBuff, extraArgsDataBuff, opName, opNum, setExtraArgs, setX, setY, setZ, toCustomOp, x, y, z
-
-
-
-
Constructor Detail
-
BaseTransformStrictOp
public BaseTransformStrictOp(SameDiff sameDiff, SDVariable i_v1, SDVariable i_v2)
-
BaseTransformStrictOp
public BaseTransformStrictOp(SameDiff sameDiff, SDVariable i_v1, SDVariable i_v2, boolean inPlace)
-
BaseTransformStrictOp
public BaseTransformStrictOp(SameDiff sameDiff, SDVariable i_v, boolean inPlace)
-
BaseTransformStrictOp
public BaseTransformStrictOp(SameDiff sameDiff, SDVariable i_v, long[] shape, boolean inPlace, Object[] extraArgs)
-
BaseTransformStrictOp
public BaseTransformStrictOp(SameDiff sameDiff, SDVariable i_v, Object[] extraArgs)
-
BaseTransformStrictOp
public BaseTransformStrictOp()
-
BaseTransformStrictOp
public BaseTransformStrictOp(INDArray x)
-
-
Method Detail
-
getOpType
public Op.Type getOpType()
- Specified by:
getOpType
in interfaceTransformOp
-
opType
public Op.Type opType()
Description copied from class:DifferentialFunction
The type of the op- Overrides:
opType
in classDifferentialFunction
- Returns:
-
resultType
public DataType resultType()
Description copied from interface:TransformOp
This method returns datatype for result array wrt given inputs- Specified by:
resultType
in interfaceTransformOp
- Returns:
-
resultType
public DataType resultType(OpContext opContext)
- Specified by:
resultType
in interfaceTransformOp
-
validateDataTypes
public boolean validateDataTypes(OpContext oc, boolean experimentalMode)
- Specified by:
validateDataTypes
in interfaceTransformOp
-
calculateOutputShape
public List<LongShapeDescriptor> calculateOutputShape()
Description copied from class:DifferentialFunction
Calculate the output shape for this op- Specified by:
calculateOutputShape
in classBaseTransformOp
- Returns:
- List of output shape descriptors
-
calculateOutputShape
public List<LongShapeDescriptor> calculateOutputShape(OpContext oc)
- Overrides:
calculateOutputShape
in classDifferentialFunction
-
calculateOutputDataTypes
public List<DataType> calculateOutputDataTypes(List<DataType> dataTypes)
Description copied from class:DifferentialFunction
Calculate the data types for the output arrays. Though datatypes can also be inferred fromDifferentialFunction.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.- Overrides:
calculateOutputDataTypes
in classDifferentialFunction
- Parameters:
dataTypes
- The data types of the inputs- Returns:
- The data types of the outputs
-
-