Class CreateView
- java.lang.Object
-
- org.nd4j.autodiff.functions.DifferentialFunction
-
- org.nd4j.linalg.api.ops.DynamicCustomOp
-
- org.nd4j.linalg.api.ops.impl.shape.CreateView
-
- All Implemented Interfaces:
CustomOp
public class CreateView extends DynamicCustomOp
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.nd4j.linalg.api.ops.DynamicCustomOp
DynamicCustomOp.DynamicCustomOpsBuilder
-
-
Field Summary
Fields Modifier and Type Field Description static int
ALL_TYPE
static int
DEFAULT_INCLUSIVE
static int
INTERVAL_TYPE
static int
NEW_AXIS
static int
POINT_TYPE
-
Fields inherited from class org.nd4j.linalg.api.ops.DynamicCustomOp
axis, bArguments, dArguments, iArguments, inplaceCall, inputArguments, outputArguments, outputVariables, sArguments, tArguments
-
Fields inherited from class org.nd4j.autodiff.functions.DifferentialFunction
dimensions, extraArgs, inPlace, ownName, ownNameSetWithDefault, sameDiff, scalarValue
-
-
Constructor Summary
Constructors Constructor Description CreateView()
CreateView(SameDiff sameDiff, SDVariable[] args)
CreateView(SameDiff sd, SDVariable input, SDVariable[] indices)
CreateView(INDArray[] inputs)
CreateView(INDArray input, INDArray[] indices)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<DataType>
calculateOutputDataTypes(List<DataType> dataTypes)
Calculate the data types for the output arrays.static SDVariable
createAll(SameDiff sameDiff)
SeecreateAll(SameDiff, String)
for more informationstatic SDVariable
createAll(SameDiff sameDiff, String name)
Create anSDVariable
representing anSDIndex.all()
variable.static INDArray
createFrom(INDArray input, INDArray... indices)
static SDVariable
createInterval(SameDiff sameDiff, long start, long end, long stride, long inclusive)
SeecreateInterval(SameDiff, String, long, long, long, long)
for more information.static SDVariable
createInterval(SameDiff sameDiff, String name, long start, long end, long stride, long inclusive)
Create an interval representingSDIndex.interval(Long, Long)
static SDVariable
createInterval(SameDiff sameDiff, String name, SDVariable start, SDVariable end, SDVariable stride, SDVariable inclusive)
Create an interval representingSDIndex.interval(Long, Long)
static SDVariable
createInterval(SameDiff sameDiff, SDVariable intervalInputBegin, SDVariable intervalInputEnd, SDVariable intervalStrideInput, SDVariable inclusive)
static SDVariable
createNewAxis(SameDiff sameDiff)
SeecreateNewAxis(SameDiff,String)
for more information.static SDVariable
createNewAxis(SameDiff sameDiff, String name)
Create anSDVariable
representing a new axis which creates a new index of length 1 in the specified inputstatic SDVariable
createPoint(SameDiff sameDiff, long offset)
SeecreatePoint(SameDiff,String,long)
for mroe information.static SDVariable
createPoint(SameDiff sameDiff, String name, long offset)
Create aSDVariable
representing a point array with the specified name.static SDVariable
createPoint(SameDiff sameDiff, String name, SDVariable offset)
Create aSDVariable
representing a point array with the specified name.static SDVariable
createPoint(SameDiff sameDiff, SDVariable offset)
SeecreatePoint(SameDiff,String,long)
for mroe information.static INDArrayIndex
fromIndexArr(INDArray index)
int
getNumOutputs()
static INDArrayIndex[]
indices(INDArray... indexArrs)
String
opName()
This method returns op opName as string-
Methods inherited from class org.nd4j.linalg.api.ops.DynamicCustomOp
addBArgument, addDArgument, addIArgument, addIArgument, addInputArgument, addOutputArgument, addOutputsToOp, addSArgument, addTArgument, assertValidForExecution, bArgs, builder, calculateOutputShape, calculateOutputShape, clearArrays, computeArrays, configureFromArguments, dArgs, doDiff, generateFake, generateFake, getBArgument, getDescriptor, getIArgument, getInputArgument, getOutputArgument, getSArgument, getTArgument, getValue, iArgs, initFromOnnx, initFromTensorFlow, inputArguments, mappingsForFunction, numBArguments, numDArguments, numIArguments, numInputArguments, numOutputArguments, numSArguments, numTArguments, onnxName, opHash, opNum, opType, outputArguments, outputVariables, outputVariables, propertiesForFunction, removeIArgument, removeInputArgument, removeOutputArgument, removeSArgument, removeTArgument, sArgs, setInputArgument, setInputArguments, setOutputArgument, setPropertiesForFunction, setValueFor, tArgs, tensorflowName, toString, wrapFilterNull, wrapOrNull, wrapOrNull
-
Methods inherited from class org.nd4j.autodiff.functions.DifferentialFunction
arg, arg, argNames, args, attributeAdaptersForFunction, configFieldName, configureWithSameDiff, diff, dup, equals, getBooleanFromProperty, getDoubleValueFromProperty, getIntValueFromProperty, getLongValueFromProperty, getStringFromProperty, hashCode, isConfigProperties, larg, onnxNames, outputs, outputVariable, outputVariablesNames, rarg, replaceArg, setInstanceId, 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.CustomOp
isInplaceCall
-
-
-
-
Constructor Detail
-
CreateView
public CreateView()
-
CreateView
public CreateView(INDArray[] inputs)
-
CreateView
public CreateView(SameDiff sameDiff, SDVariable[] args)
-
CreateView
public CreateView(SameDiff sd, SDVariable input, SDVariable[] indices)
-
-
Method Detail
-
createInterval
public static SDVariable createInterval(SameDiff sameDiff, SDVariable intervalInputBegin, SDVariable intervalInputEnd, SDVariable intervalStrideInput, SDVariable inclusive)
-
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
-
getNumOutputs
public int getNumOutputs()
- Overrides:
getNumOutputs
in classDifferentialFunction
-
opName
public String opName()
Description copied from class:DynamicCustomOp
This method returns op opName as string- Specified by:
opName
in interfaceCustomOp
- Overrides:
opName
in classDynamicCustomOp
- Returns:
-
createPoint
public static SDVariable createPoint(SameDiff sameDiff, long offset)
SeecreatePoint(SameDiff,String,long)
for mroe information.- Parameters:
sameDiff
-offset
-- Returns:
-
createPoint
public static SDVariable createPoint(SameDiff sameDiff, SDVariable offset)
SeecreatePoint(SameDiff,String,long)
for mroe information.- Parameters:
sameDiff
-offset
-- Returns:
-
createPoint
public static SDVariable createPoint(SameDiff sameDiff, String name, long offset)
Create aSDVariable
representing a point array with the specified name. This is used for specifying the equivalent of aSDIndex.point(SDVariable)
- Parameters:
sameDiff
- the samediff instance fo usename
- the name of the variable (maybe null)offset
- the offset for the point- Returns:
- the created variable
-
createPoint
public static SDVariable createPoint(SameDiff sameDiff, String name, SDVariable offset)
Create aSDVariable
representing a point array with the specified name. This is used for specifying the equivalent of aSDIndex.point(SDVariable)
- Parameters:
sameDiff
- the samediff instance fo usename
- the name of the variable (maybe null)offset
- the offset for the point- Returns:
- the created variable
-
createAll
public static SDVariable createAll(SameDiff sameDiff)
SeecreateAll(SameDiff, String)
for more information- Parameters:
sameDiff
-- Returns:
-
createAll
public static SDVariable createAll(SameDiff sameDiff, String name)
Create anSDVariable
representing anSDIndex.all()
variable.- Parameters:
sameDiff
- the samediff instance to usename
- the name of the variable (maybe null)- Returns:
- the created variable
-
createNewAxis
public static SDVariable createNewAxis(SameDiff sameDiff, String name)
Create anSDVariable
representing a new axis which creates a new index of length 1 in the specified input- Parameters:
sameDiff
- the samediff instance to usename
- the name of the variable- Returns:
- the created variable
-
createNewAxis
public static SDVariable createNewAxis(SameDiff sameDiff)
SeecreateNewAxis(SameDiff,String)
for more information.- Parameters:
sameDiff
-- Returns:
-
createInterval
public static SDVariable createInterval(SameDiff sameDiff, String name, long start, long end, long stride, long inclusive)
Create an interval representingSDIndex.interval(Long, Long)
- Parameters:
sameDiff
- the samediff instance to usename
- the name of the variablestart
- the start of the intervalend
- the end of the intervalstride
- the strideinclusive
- whether the interval is inclusive or not 0 for false 1 for true- Returns:
-
createInterval
public static SDVariable createInterval(SameDiff sameDiff, String name, SDVariable start, SDVariable end, SDVariable stride, SDVariable inclusive)
Create an interval representingSDIndex.interval(Long, Long)
- Parameters:
sameDiff
- the samediff instance to usename
- the name of the variablestart
- the start of the intervalend
- the end of the intervalstride
- the strideinclusive
- whether the interval is inclusive or not 0 for false 1 for true- Returns:
-
createInterval
public static SDVariable createInterval(SameDiff sameDiff, long start, long end, long stride, long inclusive)
SeecreateInterval(SameDiff, String, long, long, long, long)
for more information.- Parameters:
sameDiff
-start
-end
-stride
-inclusive
-- Returns:
-
indices
public static INDArrayIndex[] indices(INDArray... indexArrs)
-
fromIndexArr
public static INDArrayIndex fromIndexArr(INDArray index)
-
-