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 intALL_TYPEstatic intDEFAULT_INCLUSIVEstatic intINTERVAL_TYPEstatic intNEW_AXISstatic intPOINT_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 SDVariablecreateAll(SameDiff sameDiff)SeecreateAll(SameDiff, String)for more informationstatic SDVariablecreateAll(SameDiff sameDiff, String name)Create anSDVariablerepresenting anSDIndex.all()variable.static INDArraycreateFrom(INDArray input, INDArray... indices)static SDVariablecreateInterval(SameDiff sameDiff, long start, long end, long stride, long inclusive)SeecreateInterval(SameDiff, String, long, long, long, long)for more information.static SDVariablecreateInterval(SameDiff sameDiff, String name, long start, long end, long stride, long inclusive)Create an interval representingSDIndex.interval(Long, Long)static SDVariablecreateInterval(SameDiff sameDiff, String name, SDVariable start, SDVariable end, SDVariable stride, SDVariable inclusive)Create an interval representingSDIndex.interval(Long, Long)static SDVariablecreateInterval(SameDiff sameDiff, SDVariable intervalInputBegin, SDVariable intervalInputEnd, SDVariable intervalStrideInput, SDVariable inclusive)static SDVariablecreateNewAxis(SameDiff sameDiff)SeecreateNewAxis(SameDiff,String)for more information.static SDVariablecreateNewAxis(SameDiff sameDiff, String name)Create anSDVariablerepresenting a new axis which creates a new index of length 1 in the specified inputstatic SDVariablecreatePoint(SameDiff sameDiff, long offset)SeecreatePoint(SameDiff,String,long)for mroe information.static SDVariablecreatePoint(SameDiff sameDiff, String name, long offset)Create aSDVariablerepresenting a point array with the specified name.static SDVariablecreatePoint(SameDiff sameDiff, String name, SDVariable offset)Create aSDVariablerepresenting a point array with the specified name.static SDVariablecreatePoint(SameDiff sameDiff, SDVariable offset)SeecreatePoint(SameDiff,String,long)for mroe information.static INDArrayIndexfromIndexArr(INDArray index)intgetNumOutputs()static INDArrayIndex[]indices(INDArray... indexArrs)StringopName()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:DifferentialFunctionCalculate 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:
calculateOutputDataTypesin classDifferentialFunction- Parameters:
dataTypes- The data types of the inputs- Returns:
- The data types of the outputs
-
getNumOutputs
public int getNumOutputs()
- Overrides:
getNumOutputsin classDifferentialFunction
-
opName
public String opName()
Description copied from class:DynamicCustomOpThis method returns op opName as string- Specified by:
opNamein interfaceCustomOp- Overrides:
opNamein 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 aSDVariablerepresenting 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 aSDVariablerepresenting 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 anSDVariablerepresenting 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 anSDVariablerepresenting 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)
-
-