public class OpExecutionerUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
OpExecutionerUtil.Tensor1DStats
Simple class containing values used for calculating various quantities related to 1d tensors.
offset of ith tensor: firstTensorOffset + i * tensorStartSeparation separation between elements in tensor: elementWiseStride number of elements in each 1d tensor: tensorLength number of 1d tensors: numTensors |
Modifier and Type | Method and Description |
---|---|
static boolean |
canDoOpDirectly(INDArray x)
Can we do the op (X = Op(X)) directly on the arrays without breaking X up into 1d tensors first?
In general, this is possible if the elements of X are contiguous in the buffer, OR if every element
of X is at position offset+i*elementWiseStride in the buffer
|
static boolean |
canDoOpDirectly(INDArray x,
INDArray y)
Can we do the transform op (X = Op(X,Y)) directly on the arrays without breaking them up into 1d tensors first?
|
static boolean |
canDoOpDirectly(INDArray x,
INDArray y,
INDArray z)
Can we do the transform op (Z = Op(X,Y)) directly on the arrays without breaking them up into 1d tensors first?
|
static int |
chooseElementWiseTensorDimension(INDArray x)
Choose tensor dimension for operations with one argument: x=Op(x) or similar
When doing some operations in parallel, it is necessary to break up operations along a dimension to give a set of 1d tensors. |
static int |
chooseElementWiseTensorDimension(INDArray x,
INDArray y)
Choose tensor dimension for operations with 2 arguments: x=Op(x,y) or similar
|
static int |
chooseElementWiseTensorDimension(INDArray x,
INDArray y,
INDArray z)
Choose tensor dimension for operations with 3 arguments: z=Op(x,y) or similar
|
static OpExecutionerUtil.Tensor1DStats |
get1DTensorStats(INDArray array,
int... dimension)
Tensor1DStats, used to efficiently iterate through tensors on a matrix (2d NDArray) for element-wise ops
For example, the offset of each 1d tensor can be calculated using only a single tensorAlongDimension method call,
hence is potentially faster than approaches requiring multiple tensorAlongDimension calls.
Note that this can only (generally) be used for 2d NDArrays. |
public static boolean canDoOpDirectly(INDArray x)
public static boolean canDoOpDirectly(INDArray x, INDArray y)
public static boolean canDoOpDirectly(INDArray x, INDArray y, INDArray z)
public static int chooseElementWiseTensorDimension(INDArray x)
x
- NDArray that we want to splitpublic static int chooseElementWiseTensorDimension(INDArray x, INDArray y)
public static int chooseElementWiseTensorDimension(INDArray x, INDArray y, INDArray z)
public static OpExecutionerUtil.Tensor1DStats get1DTensorStats(INDArray array, int... dimension)
Copyright © 2016. All Rights Reserved.