public abstract class BaseOp extends DifferentialFunction implements Op
Modifier and Type | Field and Description |
---|---|
protected INDArray |
dimensionz |
protected DataBuffer |
extraArgz |
protected INDArray |
x |
protected String |
xVertexId |
protected INDArray |
y |
protected String |
yVertexId |
protected INDArray |
z |
protected String |
zVertexId |
dimensions, extraArgs, 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) |
BaseOp(SameDiff sameDiff,
boolean inPlace,
Object[] extraArgs) |
BaseOp(SameDiff sameDiff,
Object[] extraArgs) |
Modifier and Type | Method and Description |
---|---|
protected void |
defineDimensions(int... dimensions) |
INDArray |
dimensions() |
boolean |
equals(Object o) |
Object[] |
extraArgs()
Extra arguments
|
Buffer |
extraArgsBuff()
Returns a buffer of either float
or double
of the extra args for this buffer
|
DataBuffer |
extraArgsDataBuff(DataType dtype)
Returns the extra args as a data buffer
|
Number |
getFinalResult() |
int |
getNumOutputs() |
static Op.Type |
getOpType(Op op) |
int |
hashCode() |
void |
initFromOnnx(Onnx.NodeProto node,
SameDiff initWith,
Map<String,Onnx.AttributeProto> attributesForNode,
Onnx.GraphProto graph)
Iniitialize the function from the given
Onnx.NodeProto |
void |
initFromTensorFlow(NodeDef nodeDef,
SameDiff initWith,
Map<String,AttrValue> attributesForNode,
GraphDef graph)
Initialize the function from the given
NodeDef |
SDVariable[] |
outputVariables(String baseName)
Return the output functions for this differential function.
|
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, arg, argNames, args, attributeAdaptersForFunction, calculateOutputDataTypes, calculateOutputShape, configFieldName, diff, doDiff, dup, f, getValue, isConfigProperties, larg, mappingsForFunction, onnxName, onnxNames, opName, opNum, opType, outputVariable, outputVariables, outputVariablesNames, propertiesForFunction, rarg, replaceArg, resolvePropertiesFromSameDiffBeforeExecution, setInstanceId, setPropertiesForFunction, setValueFor, tensorflowName, tensorflowNames
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
opName, opNum, setExtraArgs
protected INDArray x
protected INDArray y
protected INDArray z
protected String xVertexId
protected String yVertexId
protected String zVertexId
protected DataBuffer extraArgz
protected INDArray dimensionz
public BaseOp()
public BaseOp(INDArray x, INDArray z)
x
- the inputz
- the output arraypublic BaseOp(INDArray x)
x
- the ndarraypublic void initFromTensorFlow(NodeDef nodeDef, SameDiff initWith, Map<String,AttrValue> attributesForNode, GraphDef graph)
DifferentialFunction
NodeDef
initFromTensorFlow
in class DifferentialFunction
public void initFromOnnx(Onnx.NodeProto node, SameDiff initWith, Map<String,Onnx.AttributeProto> attributesForNode, Onnx.GraphProto graph)
DifferentialFunction
Onnx.NodeProto
initFromOnnx
in class DifferentialFunction
public DataBuffer extraArgsDataBuff(DataType dtype)
Op
extraArgsDataBuff
in interface Op
public Buffer extraArgsBuff()
Op
extraArgsBuff
in interface Op
public void setZ(INDArray z)
Op
public SDVariable[] outputVariables(String baseName)
DifferentialFunction
outputVariables
in class DifferentialFunction
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 boolean equals(Object o)
equals
in class DifferentialFunction
public int hashCode()
hashCode
in class DifferentialFunction
protected void defineDimensions(int... dimensions)
public INDArray dimensions()
public Number getFinalResult()
public int getNumOutputs()
getNumOutputs
in class DifferentialFunction
Copyright © 2019. All rights reserved.