public abstract class BaseOp extends DifferentialFunction implements Op
| Modifier and Type | Field and Description |
|---|---|
protected Object[] |
extraArgs |
protected DataBuffer |
extraArgz |
protected long |
n |
protected long |
numProcessed |
protected boolean |
passThrough |
protected INDArray |
x |
protected String |
xVertexId |
protected INDArray |
y |
protected String |
yVertexId |
protected INDArray |
z |
protected String |
zVertexId |
dimensions, inPlace, sameDiff, scalarValue| Constructor and Description |
|---|
BaseOp() |
BaseOp(INDArray x)
An op for one ndarray
|
BaseOp(INDArray x,
INDArray z)
Specify an alternative result array
|
BaseOp(INDArray x,
INDArray y,
INDArray z,
long n) |
BaseOp(INDArray x,
INDArray z,
long n)
Specify an alternative output array
|
BaseOp(SameDiff sameDiff,
boolean inPlace,
Object[] extraArgs) |
BaseOp(SameDiff sameDiff,
Object[] extraArgs) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
void |
exec()
Execute the op if its pass through (not needed most of the time)
|
void |
exec(int... dimensions)
Exec along each dimension
|
Object[] |
extraArgs()
Extra arguments
|
Buffer |
extraArgsBuff()
Returns a buffer of either float
or double
of the extra args for this buffer
|
DataBuffer |
extraArgsDataBuff()
Returns the extra args as a data buffer
|
static Op.Type |
getOpType(Op op) |
int |
hashCode() |
void |
init(INDArray x,
INDArray y,
INDArray z,
long n)
Initialize the operation based on the parameters
|
void |
initFromOnnx(OnnxProto3.NodeProto node,
SameDiff initWith,
Map<String,OnnxProto3.AttributeProto> attributesForNode,
OnnxProto3.GraphProto graph)
Iniitialize the function from the given
OnnxProto3.NodeProto |
void |
initFromTensorFlow(NodeDef nodeDef,
SameDiff initWith,
Map<String,AttrValue> attributesForNode,
GraphDef graph)
Initialize the function from the given
NodeDef |
boolean |
isExecSpecial()
Whether the executioner
needs to do a special call or not
|
boolean |
isPassThrough()
Returns whether the op should be executed or not (through the executioner)
|
long |
n()
The number of elements to do a op over
|
long |
numProcessed()
Number processed
|
SDVariable[] |
outputVariables(String baseName)
Return the output functions for this differential function.
|
void |
setN(long n)
Change n
|
void |
setX(INDArray x)
set x (the input ndarray)
|
void |
setY(INDArray y)
set y(the pairwise ndarray)
|
void |
setZ(INDArray z)
set z (the solution ndarray)
|
CustomOp |
toCustomOp()
|
String |
toString() |
INDArray |
x()
The origin ndarray
|
INDArray |
y()
The pairwise op ndarray
|
INDArray |
z()
The resulting ndarray
|
arg, args, asProperties, attributeAdaptersForFunction, calculateOutputShape, configFieldName, diff, doDiff, dup, f, getValue, hasPlaceHolderInputs, isConfigProperties, larg, mappingsForFunction, onnxName, onnxNames, opName, opNum, opType, outputVariables, propertiesForFunction, rarg, resolvePropertiesFromSameDiffBeforeExecution, setInstanceId, setValueFor, tensorflowName, tensorflowNamesclone, finalize, getClass, notify, notifyAll, wait, wait, waitopName, opNum, setExtraArgsprotected INDArray x
protected INDArray y
protected INDArray z
protected long n
protected long numProcessed
protected Object[] extraArgs
protected boolean passThrough
protected String xVertexId
protected String yVertexId
protected String zVertexId
protected DataBuffer extraArgz
public BaseOp()
public BaseOp(INDArray x, INDArray z)
x - the inputz - the output arraypublic BaseOp(INDArray x, INDArray z, long n)
x - the inputz - the outputn - the number of elements to iterate onpublic BaseOp(INDArray x)
x - the ndarraypublic boolean isExecSpecial()
OpisExecSpecial in interface Oppublic void initFromTensorFlow(NodeDef nodeDef, SameDiff initWith, Map<String,AttrValue> attributesForNode, GraphDef graph)
DifferentialFunctionNodeDefinitFromTensorFlow in class DifferentialFunctionpublic void initFromOnnx(OnnxProto3.NodeProto node, SameDiff initWith, Map<String,OnnxProto3.AttributeProto> attributesForNode, OnnxProto3.GraphProto graph)
DifferentialFunctionOnnxProto3.NodeProtoinitFromOnnx in class DifferentialFunctionpublic DataBuffer extraArgsDataBuff()
OpextraArgsDataBuff in interface Oppublic Buffer extraArgsBuff()
OpextraArgsBuff in interface Oppublic boolean isPassThrough()
OpisPassThrough in interface Oppublic void setZ(INDArray z)
Oppublic SDVariable[] outputVariables(String baseName)
DifferentialFunctionoutputVariables in class DifferentialFunctionpublic long n()
Oppublic void init(INDArray x, INDArray y, INDArray z, long n)
Oppublic void setN(long n)
Oppublic long numProcessed()
OpnumProcessed in interface Oppublic CustomOp toCustomOp()
OpCustomOp
A CustomOp is a more flexible op
meant for multiple inputs and outputs.
The default implementation in BaseOp
converts a simple op to a multi input/output operation
by mapping the x and y on to inputs , the op opName
and the z on to outputs.toCustomOp in interface OpCustomOppublic void exec()
Oppublic void exec(int... dimensions)
Oppublic boolean equals(Object o)
equals in class DifferentialFunctionpublic int hashCode()
hashCode in class DifferentialFunctionCopyright © 2018. All rights reserved.