Package org.nd4j.linalg.api.ops
Class BaseReduceSameOp
- java.lang.Object
-
- org.nd4j.autodiff.functions.DifferentialFunction
-
- org.nd4j.linalg.api.ops.BaseOp
-
- org.nd4j.linalg.api.ops.BaseReduceOp
-
- org.nd4j.linalg.api.ops.BaseReduceSameOp
-
- All Implemented Interfaces:
Op
,ReduceOp
,ReduceSameOp
public abstract class BaseReduceSameOp extends BaseReduceOp implements ReduceSameOp
-
-
Field Summary
-
Fields inherited from class org.nd4j.linalg.api.ops.BaseReduceOp
dimensionVariable, isComplex, isEmptyReduce, keepDims
-
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 Modifier Constructor Description protected
BaseReduceSameOp()
BaseReduceSameOp(SameDiff sameDiff)
BaseReduceSameOp(SameDiff sameDiff, SDVariable i_v)
BaseReduceSameOp(SameDiff sameDiff, SDVariable i_v, boolean keepDims)
protected
BaseReduceSameOp(SameDiff sameDiff, SDVariable input, int... dimensions)
protected
BaseReduceSameOp(SameDiff sameDiff, SDVariable input, int[] dimensions, boolean keepDims)
BaseReduceSameOp(SameDiff sameDiff, SDVariable i_v, SDVariable i_v2)
BaseReduceSameOp(SameDiff sameDiff, SDVariable i_v, SDVariable dimensions, boolean keepDims)
BaseReduceSameOp(SameDiff sameDiff, SDVariable i_v, SDVariable i_v2, int[] dimensions)
BaseReduceSameOp(SameDiff sameDiff, SDVariable i_v, SDVariable i_v2, int[] dimensions, boolean keepDims)
BaseReduceSameOp(SameDiff sameDiff, SDVariable i_v, SDVariable i_v2, SDVariable dimensions)
BaseReduceSameOp(INDArray x, boolean keepDims, int... dimensions)
BaseReduceSameOp(INDArray x, int... dimensions)
BaseReduceSameOp(INDArray x, INDArray z, boolean keepDims, int[] dimensions)
BaseReduceSameOp(INDArray x, INDArray y, int... dimensions)
BaseReduceSameOp(INDArray x, INDArray y, INDArray z, boolean keepDims, int[] dimensions)
BaseReduceSameOp(INDArray x, INDArray y, INDArray z, int... dimensions)
-
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)
INDArray
dimensions()
This method returns dimensions for this opOp.Type
getOpType()
Op.Type
opType()
The type of the opDataType
resultType()
This method returns datatype for result array wrt given inputsDataType
resultType(OpContext oc)
boolean
validateDataTypes(OpContext oc)
-
Methods inherited from class org.nd4j.linalg.api.ops.BaseReduceOp
configureWithSameDiff, hasReductionIndices, initFromOnnx, initFromTensorFlow, isComplexAccumulation, isKeepDims, noOp, setDimensions, setPropertiesForFunction
-
Methods inherited from class org.nd4j.linalg.api.ops.BaseOp
clearArrays, computeVariables, defineDimensions, 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, configFieldName, diff, doDiff, dup, getBooleanFromProperty, getDoubleValueFromProperty, getIntValueFromProperty, getLongValueFromProperty, getStringFromProperty, getValue, isConfigProperties, larg, mappingsForFunction, onnxNames, opName, opNum, outputs, outputVariable, outputVariables, outputVariablesNames, propertiesForFunction, rarg, replaceArg, setInstanceId, 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
-
Methods inherited from interface org.nd4j.linalg.api.ops.ReduceOp
getFinalResult, isComplexAccumulation, isKeepDims, noOp, setDimensions
-
-
-
-
Constructor Detail
-
BaseReduceSameOp
public BaseReduceSameOp(SameDiff sameDiff, SDVariable i_v, SDVariable i_v2, int[] dimensions)
-
BaseReduceSameOp
public BaseReduceSameOp(SameDiff sameDiff, SDVariable i_v, boolean keepDims)
-
BaseReduceSameOp
public BaseReduceSameOp(SameDiff sameDiff, SDVariable i_v, SDVariable dimensions, boolean keepDims)
-
BaseReduceSameOp
public BaseReduceSameOp(SameDiff sameDiff, SDVariable i_v, SDVariable i_v2)
-
BaseReduceSameOp
protected BaseReduceSameOp(SameDiff sameDiff, SDVariable input, int[] dimensions, boolean keepDims)
-
BaseReduceSameOp
public BaseReduceSameOp(SameDiff sameDiff, SDVariable i_v, SDVariable i_v2, int[] dimensions, boolean keepDims)
-
BaseReduceSameOp
public BaseReduceSameOp(SameDiff sameDiff, SDVariable i_v)
-
BaseReduceSameOp
protected BaseReduceSameOp(SameDiff sameDiff, SDVariable input, int... dimensions)
-
BaseReduceSameOp
public BaseReduceSameOp(INDArray x, INDArray z, boolean keepDims, int[] dimensions)
-
BaseReduceSameOp
public BaseReduceSameOp(SameDiff sameDiff)
-
BaseReduceSameOp
public BaseReduceSameOp(SameDiff sameDiff, SDVariable i_v, SDVariable i_v2, SDVariable dimensions)
-
BaseReduceSameOp
public BaseReduceSameOp(INDArray x, int... dimensions)
-
BaseReduceSameOp
public BaseReduceSameOp(INDArray x, boolean keepDims, int... dimensions)
-
BaseReduceSameOp
protected BaseReduceSameOp()
-
-
Method Detail
-
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:ReduceOp
This method returns datatype for result array wrt given inputs- Specified by:
resultType
in interfaceReduceOp
- Returns:
-
resultType
public DataType resultType(OpContext oc)
- Specified by:
resultType
in interfaceReduceOp
-
validateDataTypes
public boolean validateDataTypes(OpContext oc)
- Specified by:
validateDataTypes
in interfaceReduceOp
-
dimensions
public INDArray dimensions()
Description copied from interface:ReduceOp
This method returns dimensions for this op- Specified by:
dimensions
in interfaceReduceOp
- Overrides:
dimensions
in classBaseOp
- Returns:
-
calculateOutputShape
public List<LongShapeDescriptor> calculateOutputShape()
Description copied from class:DifferentialFunction
Calculate the output shape for this op- Specified by:
calculateOutputShape
in classBaseReduceOp
- 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
-
-