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, tensorflowNames
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
opName, opNum, setExtraArgs
protected 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()
Op
isExecSpecial
in interface Op
public void initFromTensorFlow(NodeDef nodeDef, SameDiff initWith, Map<String,AttrValue> attributesForNode, GraphDef graph)
DifferentialFunction
NodeDef
initFromTensorFlow
in class DifferentialFunction
public void initFromOnnx(OnnxProto3.NodeProto node, SameDiff initWith, Map<String,OnnxProto3.AttributeProto> attributesForNode, OnnxProto3.GraphProto graph)
DifferentialFunction
OnnxProto3.NodeProto
initFromOnnx
in class DifferentialFunction
public DataBuffer extraArgsDataBuff()
Op
extraArgsDataBuff
in interface Op
public Buffer extraArgsBuff()
Op
extraArgsBuff
in interface Op
public boolean isPassThrough()
Op
isPassThrough
in interface Op
public void setZ(INDArray z)
Op
public SDVariable[] outputVariables(String baseName)
DifferentialFunction
outputVariables
in class DifferentialFunction
public long n()
Op
public void init(INDArray x, INDArray y, INDArray z, long n)
Op
public void setN(long n)
Op
public long numProcessed()
Op
numProcessed
in interface Op
public CustomOp toCustomOp()
Op
CustomOp
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 Op
CustomOp
public void exec()
Op
public void exec(int... dimensions)
Op
public boolean equals(Object o)
equals
in class DifferentialFunction
public int hashCode()
hashCode
in class DifferentialFunction
Copyright © 2018. All rights reserved.