Package org.nd4j.linalg.api.ops
Interface CustomOp
-
- All Known Implementing Classes:
AbsoluteDifferenceLoss
,AbsoluteDifferenceLossBp
,AdaBeliefUpdater
,AdaDeltaUpdater
,AdaGradUpdater
,AdaMaxUpdater
,AdamUpdater
,AddBpOp
,AddOp
,AdjustContrast
,AdjustHue
,AdjustSaturation
,AmsGradUpdater
,Angle
,ApplyGradientDescent
,ArgAmax
,ArgAmin
,ArgMax
,ArgMin
,Assert
,Assign
,ATan2
,AvgPooling2D
,AvgPooling3D
,BarnesEdgeForces
,BarnesHutGains
,BarnesHutSymmetrize
,BaseArithmeticBackpropOp
,BaseCompatOp
,BaseDynamicCustomBoolReduction
,BaseDynamicCustomIndexReduction
,BaseDynamicCustomLongReduction
,BaseDynamicCustomReduction
,BaseDynamicTransformOp
,BaseLoss
,BaseLossBp
,BaseReductionBp
,BaseTensorOp
,BatchMmul
,BatchNorm
,BatchNormDerivative
,BatchToSpace
,BatchToSpaceND
,BetaInc
,BiasAdd
,BiasAddGrad
,BinCount
,BitCast
,BitsHammingDistance
,BitwiseAnd
,BitwiseOr
,BitwiseXor
,BroadcastDynamicShape
,BroadcastTo
,Cast
,CbowRound
,CheckNumerics
,Cholesky
,Choose
,ClipByAvgNorm
,ClipByNorm
,ClipByNormBp
,ClipByValue
,Col2Im
,CompareAndBitpack
,CompatSparseToDense
,CompatStringSplit
,Concat
,ConcatBp
,ConfusionMatrix
,Conv1D
,Conv1DDerivative
,Conv2D
,Conv2DDerivative
,Conv3D
,Conv3DDerivative
,CosineDistanceLoss
,CosineDistanceLossBp
,Create
,CreateView
,CReLU
,CReluBp
,CropAndResize
,Cross
,CtcLoss
,CtcLossBp
,CubeBp
,CumProd
,CumProdBp
,CumSum
,CumSumBp
,CyclicRShiftBits
,CyclicShiftBits
,DecodeBitmap
,DecodeThreshold
,DeConv2D
,DeConv2DDerivative
,DeConv2DTF
,DeConv3D
,DeConv3DDerivative
,DeConv3DTF
,DepthToSpace
,DepthwiseConv2D
,DepthwiseConv2DBp
,Diag
,DiagPart
,Digamma
,Dilation2D
,DistributionUniform
,DivBpOp
,DivideNoNan
,DivOp
,DotBp
,DotProductAttention
,DotProductAttentionBp
,DrawBoundingBoxes
,DynamicCustomOp
,DynamicPartition
,DynamicPartitionBp
,DynamicStitch
,Eig
,ELU
,EluBp
,EmbeddingLookup
,EncodeBitmap
,EncodeThreshold
,Enter
,EqualTo
,Exit
,ExpandDims
,ExternalErrorsFunction
,ExtractImagePatches
,Eye
,FakeQuantWithMinMaxArgs
,FakeQuantWithMinMaxVars
,FakeQuantWithMinMaxVarsPerChannel
,Fill
,Flatten
,Flatten2D
,FloorDivBpOp
,FloorDivOp
,FloorModBpOp
,FloorModOp
,FusedBatchNorm
,Gather
,GatherNd
,GradientBackwardsMarker
,GreaterThan
,GreaterThanOrEqual
,GRU
,GRUBp
,GRUCell
,HardSigmoidBp
,HardTanhBp
,HashCode
,HingeLoss
,HingeLossBp
,Histogram
,HistogramFixedWidth
,HsvToRgb
,HuberLoss
,HuberLossBp
,Identity
,IdentityN
,Igamma
,Igammac
,Im2col
,Im2colBp
,ImageResize
,InTopK
,InvertPermutation
,Invoke
,IsMax
,IsNonDecreasing
,IsNumericTensor
,IsStrictlyIncreasing
,KnnMinDistance
,L2Loss
,LayerNorm
,LayerNormBp
,LeakyReLUBp
,LessThan
,LessThanOrEqual
,Lgamma
,LinearSolve
,Linspace
,ListDiff
,LocalResponseNormalization
,LocalResponseNormalizationDerivative
,Logdet
,LogicalAnd
,LogicalNot
,LogicalOr
,LogicalXor
,LogLoss
,LogLossBp
,LogMatrixDeterminant
,LogPoissonLoss
,LogPoissonLossBp
,LogSoftMax
,LogSoftMaxDerivative
,LogSumExp
,LoopCond
,LSTMBlock
,LSTMBlockCell
,LSTMCell
,LSTMLayer
,LSTMLayerBp
,Lstsq
,Lu
,MatrixBandPart
,MatrixDeterminant
,MatrixDiag
,MatrixDiagPart
,MatrixInverse
,MatrixSetDiag
,Max
,MaxBp
,MaximumBp
,MaxPooling2D
,MaxPooling3D
,MaxPoolWithArgmax
,MeanBp
,MeanPairwiseSquaredErrorLoss
,MeanPairwiseSquaredErrorLossBp
,MeanSquaredErrorLoss
,MeanSquaredErrorLossBp
,Merge
,MergeAddBp
,MergeAddOp
,MergeAvg
,MergeAvgBp
,MergeMax
,MergeMaxBp
,MergeMaxIndex
,MergeSum
,MeshGrid
,Min
,MinBp
,MinMaxDataType
,MirrorPad
,Mmul
,MmulBp
,ModBpOp
,ModOp
,Moments
,MulBpOp
,MulOp
,MultiHeadDotProductAttention
,MultiHeadDotProductAttentionBp
,NadamUpdater
,NesterovsUpdater
,NextIteration
,NonMaxSuppression
,NonMaxSuppressionV3
,NonMaxSuppressionWithOverlaps
,NoOp
,Norm1Bp
,Norm2Bp
,NormalizeMoments
,NormMaxBp
,NotEqualTo
,NthElement
,OneHot
,OnesAs
,OnesLike
,Pad
,ParallelConcat
,ParallelStack
,Permute
,Polygamma
,Pooling2D
,Pooling2DDerivative
,Pooling3D
,Pooling3DDerivative
,Pow
,PowBp
,PRelu
,PReluBp
,PrintAffinity
,PrintVariable
,ProdBp
,Qr
,RandomBernoulli
,RandomCrop
,RandomExponential
,RandomGamma
,RandomMultinomial
,RandomNormal
,RandomPoisson
,RandomShuffle
,RandomStandardNormal
,Range
,Rank
,RationalTanhBp
,RDivBpOp
,RDivOp
,RealDivOp
,RectifiedLinearDerivative
,RectifiedTanhBp
,ReductionShape
,Relu6Derivative
,ReluLayer
,Repeat
,Reshape
,ResizeArea
,ResizeBicubic
,ResizeBilinear
,ResizeNearestNeighbor
,RestoreV2
,Reverse
,ReverseBp
,ReverseSequence
,ReverseV2
,RgbToGrayscale
,RgbToHsv
,RgbToYiq
,RgbToYuv
,RmsPropUpdater
,Roll
,RShiftBits
,RSubBpOp
,RSubOp
,SaveV2
,ScatterAdd
,ScatterDiv
,ScatterMax
,ScatterMin
,ScatterMul
,ScatterNd
,ScatterNdAdd
,ScatterNdSub
,ScatterNdUpdate
,ScatterSub
,ScatterUpdate
,SConv2D
,SConv2DDerivative
,SegmentMax
,SegmentMaxBp
,SegmentMean
,SegmentMeanBp
,SegmentMin
,SegmentMinBp
,SegmentProd
,SegmentProdBp
,SegmentSum
,SegmentSumBp
,Select
,SeluBp
,SequenceMask
,SetShape
,SgdUpdater
,Shape
,ShapeN
,ShiftBits
,SigmoidCrossEntropyLoss
,SigmoidCrossEntropyLossBp
,SigmoidDerivative
,Size
,SizeAt
,SkipGramRound
,Slice
,SliceBp
,SoftMax
,SoftmaxBp
,SoftmaxCrossEntropyLoss
,SoftmaxCrossEntropyLossBp
,SoftmaxCrossEntropyWithLogitsLoss
,SoftmaxCrossEntropyWithLogitsLossBp
,SoftPlusBp
,SoftSignBp
,SpaceToBatch
,SpaceToBatchND
,SpaceToDepth
,SparseSoftmaxCrossEntropyLossWithLogits
,SparseSoftmaxCrossEntropyLossWithLogitsBp
,Split
,SplitV
,SpTreeCell
,SqrtM
,SquaredDifferenceBpOp
,SquaredDifferenceOp
,SquaredNormBp
,Squeeze
,SRU
,SRUCell
,Stack
,StandardDeviationBp
,Standardize
,StandardizeBp
,StopGradient
,StridedSlice
,StridedSliceBp
,SubBpOp
,SubOp
,SufficientStatistics
,SumBp
,Svd
,Switch
,TanhDerivative
,TensorArray
,TensorArrayConcat
,TensorArrayGather
,TensorArrayRead
,TensorArrayRemove
,TensorArrayScatter
,TensorArraySize
,TensorArraySplit
,TensorArrayWrite
,TensorMmul
,TensorMmulBp
,ThresholdRelu
,ThresholdReluBp
,Tile
,TileBp
,ToggleBits
,TopK
,Trace
,Transpose
,Tri
,TriangularSolve
,Triu
,TriuBp
,TruncateDivOp
,Unique
,UniqueWithCounts
,UnsortedSegmentMax
,UnsortedSegmentMaxBp
,UnsortedSegmentMean
,UnsortedSegmentMeanBp
,UnsortedSegmentMin
,UnsortedSegmentMinBp
,UnsortedSegmentProd
,UnsortedSegmentProdBp
,UnsortedSegmentSqrtN
,UnsortedSegmentSqrtNBp
,UnsortedSegmentSum
,UnsortedSegmentSumBp
,Unstack
,Upsampling2d
,Upsampling2dDerivative
,Upsampling3d
,Upsampling3dBp
,VarianceBp
,WeightedCrossEntropyLoss
,Where
,WhereNumpy
,While
,XwPlusB
,YiqToRgb
,YuvToRgb
,ZeroFraction
,ZerosLike
,Zeta
public interface CustomOp
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addBArgument(boolean... arg)
void
addDArgument(DataType... arg)
void
addIArgument(int... arg)
void
addIArgument(long... arg)
void
addInputArgument(INDArray... arg)
void
addOutputArgument(INDArray... arg)
void
addSArgument(String... args)
void
addTArgument(double... arg)
void
assertValidForExecution()
Asserts a valid state for execution, otherwise throws anND4JIllegalStateException
boolean[]
bArgs()
List<LongShapeDescriptor>
calculateOutputShape()
Calculate the output shape for this opList<LongShapeDescriptor>
calculateOutputShape(OpContext opContext)
Calculate the output shape for this opvoid
clearArrays()
Clear the input and output INDArrays, if any are setvoid
configureFromArguments()
This allows a custom op to configure relevant fields from its arguments.DataType[]
dArgs()
Boolean
getBArgument(int index)
CustomOpDescriptor
getDescriptor()
Get the custom op descriptor if one is available.Long
getIArgument(int index)
INDArray
getInputArgument(int index)
INDArray
getOutputArgument(int index)
String
getSArgument(int index)
Double
getTArgument(int index)
long[]
iArgs()
List<INDArray>
inputArguments()
boolean
isInplaceCall()
This method returns true if op is supposed to be executed inplaceint
numBArguments()
int
numDArguments()
int
numIArguments()
int
numInputArguments()
int
numOutputArguments()
int
numSArguments()
int
numTArguments()
long
opHash()
This method returns LongHash of the opName()String
opName()
This method returns op opName as stringList<INDArray>
outputArguments()
void
removeIArgument(Integer arg)
void
removeInputArgument(INDArray arg)
void
removeOutputArgument(INDArray arg)
void
removeSArgument(String argument)
void
removeTArgument(Double arg)
String[]
sArgs()
double[]
tArgs()
-
-
-
Method Detail
-
configureFromArguments
void configureFromArguments()
This allows a custom op to configure relevant fields from its arguments. This is needed when ops are created via reflection for things like model import.
-
opName
String opName()
This method returns op opName as string- Returns:
-
opHash
long opHash()
This method returns LongHash of the opName()- Returns:
-
isInplaceCall
boolean isInplaceCall()
This method returns true if op is supposed to be executed inplace- Returns:
-
iArgs
long[] iArgs()
-
tArgs
double[] tArgs()
-
bArgs
boolean[] bArgs()
-
dArgs
DataType[] dArgs()
-
addTArgument
void addTArgument(double... arg)
-
sArgs
String[] sArgs()
-
addIArgument
void addIArgument(int... arg)
-
addIArgument
void addIArgument(long... arg)
-
addBArgument
void addBArgument(boolean... arg)
-
addDArgument
void addDArgument(DataType... arg)
-
removeIArgument
void removeIArgument(Integer arg)
-
addSArgument
void addSArgument(String... args)
-
removeSArgument
void removeSArgument(String argument)
-
getSArgument
String getSArgument(int index)
-
getBArgument
Boolean getBArgument(int index)
-
getIArgument
Long getIArgument(int index)
-
numIArguments
int numIArguments()
-
removeTArgument
void removeTArgument(Double arg)
-
getTArgument
Double getTArgument(int index)
-
numTArguments
int numTArguments()
-
numBArguments
int numBArguments()
-
numDArguments
int numDArguments()
-
numSArguments
int numSArguments()
-
addInputArgument
void addInputArgument(INDArray... arg)
-
removeInputArgument
void removeInputArgument(INDArray arg)
-
getInputArgument
INDArray getInputArgument(int index)
-
numInputArguments
int numInputArguments()
-
addOutputArgument
void addOutputArgument(INDArray... arg)
-
removeOutputArgument
void removeOutputArgument(INDArray arg)
-
getOutputArgument
INDArray getOutputArgument(int index)
-
numOutputArguments
int numOutputArguments()
-
calculateOutputShape
List<LongShapeDescriptor> calculateOutputShape()
Calculate the output shape for this op- Returns:
- Output array shapes
-
calculateOutputShape
List<LongShapeDescriptor> calculateOutputShape(OpContext opContext)
Calculate the output shape for this op- Returns:
- Output array shapes
-
getDescriptor
CustomOpDescriptor getDescriptor()
Get the custom op descriptor if one is available.- Returns:
-
assertValidForExecution
void assertValidForExecution()
Asserts a valid state for execution, otherwise throws anND4JIllegalStateException
-
clearArrays
void clearArrays()
Clear the input and output INDArrays, if any are set
-
-