Package org.nd4j.linalg.api.ops
Class BaseBroadcastOp
- java.lang.Object
-
- org.nd4j.autodiff.functions.DifferentialFunction
-
- org.nd4j.linalg.api.ops.BaseOp
-
- org.nd4j.linalg.api.ops.BaseBroadcastOp
-
- All Implemented Interfaces:
BroadcastOp
,Op
- Direct Known Subclasses:
BroadcastAddOp
,BroadcastAMax
,BroadcastAMin
,BroadcastCopyOp
,BroadcastDivOp
,BroadcastGradientArgs
,BroadcastMax
,BroadcastMin
,BroadcastMulOp
,BroadcastRDivOp
,BroadcastRSubOp
,BroadcastSubOp
public abstract class BaseBroadcastOp extends BaseOp implements BroadcastOp
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]
dimension
-
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 BaseBroadcastOp(SameDiff sameDiff)
BaseBroadcastOp(SameDiff sameDiff, SDVariable i_v, int[] dimension, boolean inPlace)
BaseBroadcastOp(SameDiff sameDiff, SDVariable i_v, int[] dimension, Object[] extraArgs)
BaseBroadcastOp(SameDiff sameDiff, SDVariable i_v, long[] shape, boolean inPlace, int[] dimension, Object[] extraArgs)
BaseBroadcastOp(SameDiff sameDiff, SDVariable i_v1, SDVariable i_v2, boolean inPlace, int[] dimension)
BaseBroadcastOp(SameDiff sameDiff, SDVariable i_v1, SDVariable i_v2, int[] dimension)
BaseBroadcastOp(SameDiff sameDiff, SDVariable i_v1, SDVariable i_v2, int[] dimension, Object[] extraArgs)
BaseBroadcastOp(INDArray x, INDArray y, INDArray z, int... dimension)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<LongShapeDescriptor>
calculateOutputShape()
Calculate the output shape for this opint[]
getDimension()
Dimension to do the vector op along.Op.Type
getOpType()
void
initFromOnnx(Onnx.NodeProto node, SameDiff initWith, Map<String,Onnx.AttributeProto> attributesForNode, Onnx.GraphProto graph)
Iniitialize the function from the givenOnnx.NodeProto
void
initFromTensorFlow(NodeDef nodeDef, SameDiff initWith, Map<String,AttrValue> attributesForNode, GraphDef graph)
Initialize the function from the givenNodeDef
Op.Type
opType()
The type of the opvoid
setDimension(int... dimension)
Set the dimension for the vector op.boolean
validateDataTypes(boolean experimentalMode)
-
Methods inherited from class org.nd4j.linalg.api.ops.BaseOp
clearArrays, computeVariables, defineDimensions, dimensions, equals, extraArgs, extraArgsBuff, extraArgsDataBuff, getFinalResult, getInputArgument, getNumOutputs, getOpType, hashCode, onnxName, outputVariables, setX, setY, setZ, tensorflowName, toCustomOp, toString, x, y, z
-
Methods inherited from class org.nd4j.autodiff.functions.DifferentialFunction
arg, arg, argNames, args, attributeAdaptersForFunction, calculateOutputDataTypes, calculateOutputShape, 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.BroadcastOp
dimensions
-
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
-
BaseBroadcastOp
public BaseBroadcastOp(SameDiff sameDiff, SDVariable i_v1, SDVariable i_v2, int[] dimension)
-
BaseBroadcastOp
public BaseBroadcastOp(SameDiff sameDiff, SDVariable i_v1, SDVariable i_v2, boolean inPlace, int[] dimension)
-
BaseBroadcastOp
public BaseBroadcastOp(SameDiff sameDiff)
-
BaseBroadcastOp
public BaseBroadcastOp(SameDiff sameDiff, SDVariable i_v1, SDVariable i_v2, int[] dimension, Object[] extraArgs)
-
BaseBroadcastOp
public BaseBroadcastOp(SameDiff sameDiff, SDVariable i_v, int[] dimension, boolean inPlace)
-
BaseBroadcastOp
public BaseBroadcastOp(SameDiff sameDiff, SDVariable i_v, long[] shape, boolean inPlace, int[] dimension, Object[] extraArgs)
-
BaseBroadcastOp
public BaseBroadcastOp(SameDiff sameDiff, SDVariable i_v, int[] dimension, Object[] extraArgs)
-
-
Method Detail
-
opType
public Op.Type opType()
Description copied from class:DifferentialFunction
The type of the op- Overrides:
opType
in classDifferentialFunction
- Returns:
-
calculateOutputShape
public List<LongShapeDescriptor> calculateOutputShape()
Calculate the output shape for this op- Overrides:
calculateOutputShape
in classDifferentialFunction
- Returns:
-
getDimension
public int[] getDimension()
Description copied from interface:BroadcastOp
Dimension to do the vector op along. Along dimension 1 for row vector ops, along 0 for column vector ops- Specified by:
getDimension
in interfaceBroadcastOp
-
setDimension
public void setDimension(int... dimension)
Description copied from interface:BroadcastOp
Set the dimension for the vector op.- Specified by:
setDimension
in interfaceBroadcastOp
-
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 classBaseOp
-
initFromOnnx
public void initFromOnnx(Onnx.NodeProto node, SameDiff initWith, Map<String,Onnx.AttributeProto> attributesForNode, Onnx.GraphProto graph)
Description copied from class:DifferentialFunction
Iniitialize the function from the givenOnnx.NodeProto
- Overrides:
initFromOnnx
in classBaseOp
-
validateDataTypes
public boolean validateDataTypes(boolean experimentalMode)
- Specified by:
validateDataTypes
in interfaceBroadcastOp
-
getOpType
public Op.Type getOpType()
- Specified by:
getOpType
in interfaceBroadcastOp
-
-