public class SameDiffOpExecutioner extends Object implements OpExecutioner, OpProfiler.OpProfilerListener
OpExecutioner.ExecutionMode, OpExecutioner.ProfilingMode
Constructor and Description |
---|
SameDiffOpExecutioner() |
Modifier and Type | Method and Description |
---|---|
INDArray |
bitmapDecode(INDArray encoded,
INDArray target) |
INDArray |
bitmapEncode(INDArray indArray,
double threshold) |
long |
bitmapEncode(INDArray indArray,
INDArray target,
double threshold)
This method returns number of elements affected by encoder
|
List<int[]> |
calculateOutputShape(CustomOp op) |
void |
commit()
This method ensures all operations that supposed to be executed at this moment, are executed and finished.
|
void |
enableDebugMode(boolean reallyEnable) |
void |
enableVerboseMode(boolean reallyEnable) |
INDArray |
exec(Accumulation accumulation,
int... dimension)
Execute an accumulation along one or more dimensions
|
void |
exec(Aggregate op) |
<T extends Aggregate> |
exec(Batch<T> batch)
This method executes previously built batch
|
INDArray |
exec(BroadcastOp broadcast,
int... dimension)
Execute an broadcast along one or more dimensions
|
void |
exec(CustomOp op)
This method executes given CustomOp
|
void |
exec(GridOp op)
Execute GridOp
|
INDArray |
exec(IndexAccumulation indexAccum,
int... dimension)
Execute an index accumulation along one or more dimensions
|
void |
exec(List<Aggregate> batch)
This method takes arbitrary sized list of aggregates, and packs them into batches
|
void |
exec(MetaOp op)
Execute MetaOp
|
Op |
exec(Op op)
Execute the operation
|
Op |
exec(Op op,
int... dimension)
Execute the operation along 1 or more dimensions
|
INDArray |
exec(RandomOp op)
This method executes specified RandomOp using default RNG available via Nd4j.getRandom()
|
INDArray |
exec(RandomOp op,
Random rng)
This method executes specific RandomOp against specified RNG
|
void |
exec(ShapeOp op) |
INDArray |
exec(Variance accumulation,
boolean biasCorrected,
int... dimension)
Execute an accumulation along one or more dimensions
|
Accumulation |
execAndReturn(Accumulation op)
Execute and return the result from an accumulation
|
INDArray |
execAndReturn(BroadcastOp op)
Execute and return the result from a vector op
|
IndexAccumulation |
execAndReturn(IndexAccumulation op)
Execute and return the result from an index accumulation
|
INDArray |
execAndReturn(Op op)
Execute and return a result
ndarray from the given op
|
INDArray |
execAndReturn(ScalarOp op)
Execute and return the result from a scalar op
|
INDArray |
execAndReturn(ShapeOp op)
Execute and return the result from a vector op
|
INDArray |
execAndReturn(TransformOp op)
Execute a TransformOp and return the result
|
Accumulation |
execAndReturn(Variance op,
boolean biasCorrected)
Execute and return the result from an accumulation
|
Map<String,INDArray> |
executeGraph(long id,
Map<String,INDArray> map) |
OpExecutioner.ExecutionMode |
executionMode()
Get the execution mode for this
execuioner
|
void |
forgetGraph(long id) |
Map<String,CustomOpDescriptor> |
getCustomOperations()
This method returns names of all custom operations available in current backend, and their number of input/output arguments
|
Properties |
getEnvironmentInformation()
This method return set of key/value and
key/key/value objects,
describing current environment
|
String |
getLastOp()
This method returns opName of the last invoked op
|
OpExecutioner.ProfilingMode |
getProfilingMode()
Ths method returns current profiling
|
TADManager |
getTADManager()
This method returns TADManager instance used for this OpExecutioner
|
void |
invoke(Op op) |
void |
iterateOverAllColumns(Op op)
Iterate over every column of every slice
|
void |
iterateOverAllRows(Op op)
Iterate over every row of every slice
|
void |
printEnvironmentInformation()
This method prints out environmental information returned by getEnvironmentInformation() method
|
void |
push()
This method ensures all operations that supposed to be executed at this moment, are executed.
|
void |
registerGraph(long id,
org.bytedeco.javacpp.Pointer graph) |
void |
setElementsThreshold(int threshold)
This method allows to set desired number of elements per thread, for performance optimization purposes.
|
void |
setExecutionMode(OpExecutioner.ExecutionMode executionMode)
Set the execution mode
|
void |
setProfilingMode(OpExecutioner.ProfilingMode mode)
This method specifies desired profiling mode
|
void |
setTadThreshold(int threshold)
This method allows to set desired number of sub-arrays per thread, for performance optimization purposes.
|
INDArray |
thresholdDecode(INDArray encoded,
INDArray target)
This method decodes thresholds array, and puts it into target array
|
INDArray |
thresholdEncode(INDArray input,
double threshold)
This method encodes array as thresholds, updating input array at the same time
|
INDArray |
thresholdEncode(INDArray input,
double threshold,
Integer boundary)
This method encodes array as thresholds, updating input array at the same time
|
public String getLastOp()
getLastOp
in interface OpExecutioner
public Op exec(Op op)
exec
in interface OpExecutioner
op
- the operation to executepublic void iterateOverAllRows(Op op)
iterateOverAllRows
in interface OpExecutioner
op
- the operation to applypublic void iterateOverAllColumns(Op op)
iterateOverAllColumns
in interface OpExecutioner
op
- the operation to applypublic INDArray execAndReturn(TransformOp op)
execAndReturn
in interface OpExecutioner
op
- the operation to executepublic Accumulation execAndReturn(Accumulation op)
execAndReturn
in interface OpExecutioner
op
- the operation to executepublic Accumulation execAndReturn(Variance op, boolean biasCorrected)
execAndReturn
in interface OpExecutioner
op
- the operation to executebiasCorrected
- public IndexAccumulation execAndReturn(IndexAccumulation op)
execAndReturn
in interface OpExecutioner
op
- the index accumulation operation to executepublic INDArray execAndReturn(ScalarOp op)
execAndReturn
in interface OpExecutioner
op
- the operation to executepublic INDArray execAndReturn(BroadcastOp op)
execAndReturn
in interface OpExecutioner
op
- public INDArray execAndReturn(ShapeOp op)
execAndReturn
in interface OpExecutioner
op
- public Op exec(Op op, int... dimension)
exec
in interface OpExecutioner
op
- the operation to executedimension
- public INDArray exec(Accumulation accumulation, int... dimension)
exec
in interface OpExecutioner
accumulation
- the accumulationdimension
- the dimensionpublic INDArray exec(BroadcastOp broadcast, int... dimension)
exec
in interface OpExecutioner
broadcast
- the accumulationdimension
- the dimensionpublic INDArray exec(Variance accumulation, boolean biasCorrected, int... dimension)
exec
in interface OpExecutioner
accumulation
- the accumulationbiasCorrected
- dimension
- the dimension @return the accmulation oppublic INDArray exec(IndexAccumulation indexAccum, int... dimension)
exec
in interface OpExecutioner
indexAccum
- the index accumulation operationdimension
- the dimension/s to execute alongpublic INDArray execAndReturn(Op op)
execAndReturn
in interface OpExecutioner
op
- the operation to executepublic OpExecutioner.ExecutionMode executionMode()
executionMode
in interface OpExecutioner
public void setExecutionMode(OpExecutioner.ExecutionMode executionMode)
setExecutionMode
in interface OpExecutioner
executionMode
- the execution modepublic void exec(MetaOp op)
exec
in interface OpExecutioner
op
- public void exec(GridOp op)
exec
in interface OpExecutioner
op
- public void exec(Aggregate op)
exec
in interface OpExecutioner
public void exec(ShapeOp op)
exec
in interface OpExecutioner
op
- public <T extends Aggregate> void exec(Batch<T> batch)
exec
in interface OpExecutioner
batch
- public void exec(List<Aggregate> batch)
exec
in interface OpExecutioner
batch
- public INDArray exec(RandomOp op)
exec
in interface OpExecutioner
op
- public INDArray exec(RandomOp op, Random rng)
exec
in interface OpExecutioner
op
- rng
- public Properties getEnvironmentInformation()
getEnvironmentInformation
in interface OpExecutioner
public void setProfilingMode(OpExecutioner.ProfilingMode mode)
setProfilingMode
in interface OpExecutioner
mode
- public OpExecutioner.ProfilingMode getProfilingMode()
getProfilingMode
in interface OpExecutioner
public TADManager getTADManager()
getTADManager
in interface OpExecutioner
public void printEnvironmentInformation()
printEnvironmentInformation
in interface OpExecutioner
public void push()
push
in interface OpExecutioner
public void commit()
commit
in interface OpExecutioner
public INDArray thresholdEncode(INDArray input, double threshold)
thresholdEncode
in interface OpExecutioner
input
- threshold
- public INDArray thresholdEncode(INDArray input, double threshold, Integer boundary)
thresholdEncode
in interface OpExecutioner
input
- threshold
- boundary
- @return encoded array is returnedpublic INDArray thresholdDecode(INDArray encoded, INDArray target)
thresholdDecode
in interface OpExecutioner
encoded
- target
- public long bitmapEncode(INDArray indArray, INDArray target, double threshold)
bitmapEncode
in interface OpExecutioner
indArray
- target
- threshold
- public INDArray bitmapEncode(INDArray indArray, double threshold)
bitmapEncode
in interface OpExecutioner
public INDArray bitmapDecode(INDArray encoded, INDArray target)
bitmapDecode
in interface OpExecutioner
public void invoke(Op op)
invoke
in interface OpProfiler.OpProfilerListener
public Map<String,CustomOpDescriptor> getCustomOperations()
OpExecutioner
getCustomOperations
in interface OpExecutioner
public void exec(CustomOp op)
PLEASE NOTE: You're responsible for input/output validation
exec
in interface OpExecutioner
op
- public List<int[]> calculateOutputShape(CustomOp op)
calculateOutputShape
in interface OpExecutioner
public void registerGraph(long id, org.bytedeco.javacpp.Pointer graph)
registerGraph
in interface OpExecutioner
public Map<String,INDArray> executeGraph(long id, Map<String,INDArray> map)
executeGraph
in interface OpExecutioner
public void forgetGraph(long id)
forgetGraph
in interface OpExecutioner
public void enableDebugMode(boolean reallyEnable)
enableDebugMode
in interface OpExecutioner
public void enableVerboseMode(boolean reallyEnable)
enableVerboseMode
in interface OpExecutioner
public void setElementsThreshold(int threshold)
Default value: 1024
setElementsThreshold
in interface OpExecutioner
threshold
- public void setTadThreshold(int threshold)
Default value: 8
setTadThreshold
in interface OpExecutioner
threshold
- Copyright © 2018. All rights reserved.