Package org.nd4j.linalg.api.ops
Class BaseIndexAccumulation
- java.lang.Object
-
- org.nd4j.autodiff.functions.DifferentialFunction
-
- org.nd4j.linalg.api.ops.BaseOp
-
- org.nd4j.linalg.api.ops.BaseIndexAccumulation
-
- All Implemented Interfaces:
IndexAccumulation
,Op
- Direct Known Subclasses:
FirstIndex
,LastIndex
public abstract class BaseIndexAccumulation extends BaseOp implements IndexAccumulation
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
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 Constructor Description BaseIndexAccumulation()
BaseIndexAccumulation(SameDiff sameDiff, SDVariable i_v, boolean keepDims, int[] dimensions)
BaseIndexAccumulation(SameDiff sameDiff, SDVariable i_v, SDVariable i_v2, boolean keepDims, int[] dimensions)
BaseIndexAccumulation(INDArray x, boolean keepDims, int[] dimensions)
BaseIndexAccumulation(INDArray x, int[] dimensions)
BaseIndexAccumulation(INDArray x, 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)
Op.Type
opType()
The type of the opboolean
validateDataTypes()
-
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, z
-
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.IndexAccumulation
dimensions, getFinalResult, isKeepDims
-
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
-
BaseIndexAccumulation
public BaseIndexAccumulation(SameDiff sameDiff, SDVariable i_v, boolean keepDims, int[] dimensions)
-
BaseIndexAccumulation
public BaseIndexAccumulation(SameDiff sameDiff, SDVariable i_v, SDVariable i_v2, boolean keepDims, int[] dimensions)
-
BaseIndexAccumulation
public BaseIndexAccumulation()
-
BaseIndexAccumulation
public BaseIndexAccumulation(INDArray x, int[] dimensions)
-
BaseIndexAccumulation
public BaseIndexAccumulation(INDArray x, boolean keepDims, int[] dimensions)
-
-
Method Detail
-
calculateOutputShape
public List<LongShapeDescriptor> calculateOutputShape()
Description copied from class:DifferentialFunction
Calculate the output shape for this op- Overrides:
calculateOutputShape
in classDifferentialFunction
- Returns:
- List of output shape descriptors
-
calculateOutputShape
public List<LongShapeDescriptor> calculateOutputShape(OpContext oc)
- Overrides:
calculateOutputShape
in classDifferentialFunction
-
opType
public Op.Type opType()
Description copied from class:DifferentialFunction
The type of the op- Overrides:
opType
in classDifferentialFunction
- Returns:
-
validateDataTypes
public boolean validateDataTypes()
- Specified by:
validateDataTypes
in interfaceIndexAccumulation
-
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
-
-