public class TadCollapseAccumulation extends BaseOp
Modifier and Type | Field and Description |
---|---|
protected Op |
accum |
static String |
DEFAULT_NAME |
protected int[] |
originalDimension |
protected boolean |
performSmallerDimension |
protected int[] |
smallerDimension |
protected int |
tadsForLargerDimension |
protected int |
tadsForSmallerDimension |
extraArgs, extraArgz, n, numProcessed, passThrough, x, y, z
Constructor and Description |
---|
TadCollapseAccumulation() |
TadCollapseAccumulation(INDArray x,
INDArray y,
INDArray z,
long n,
Op accum) |
TadCollapseAccumulation(INDArray x,
INDArray z,
long n,
Op accum) |
TadCollapseAccumulation(INDArray x,
INDArray z,
Op accum) |
TadCollapseAccumulation(INDArray x,
Op accum) |
TadCollapseAccumulation(Op accum) |
TadCollapseAccumulation(Op accum,
int[] originalDimension) |
TadCollapseAccumulation(Op accum,
int[] originalDimension,
int[] smallerDimension) |
TadCollapseAccumulation(Op accum,
int[] originalDimension,
int[] smallerDimension,
boolean performSmallerDimension) |
Modifier and Type | Method and Description |
---|---|
void |
exec()
Execute the op if its pass through (not needed most of the time)
|
void |
exec(int... dimensions)
Exec along each dimension
|
Op |
getAccum() |
boolean |
isPassThrough()
Returns whether the op should be executed or not (through the executioner)
|
String |
name()
The name of this operation
|
double |
op(double origin)
Transform an individual element
|
double |
op(double origin,
double other)
Pairwise op (applicable with an individual element in y)
|
float |
op(float origin)
Transform an individual element
|
float |
op(float origin,
float other)
Pairwise op (applicable with an individual element in y)
|
IComplexNumber |
op(IComplexNumber origin)
Transform an individual element
|
IComplexNumber |
op(IComplexNumber origin,
double other)
Pairwise op (applicable with an individual element in y)
|
IComplexNumber |
op(IComplexNumber origin,
float other)
Pairwise op (applicable with an individual element in y)
|
IComplexNumber |
op(IComplexNumber origin,
IComplexNumber other)
Pairwise op (applicable with an individual element in y)
|
Op |
opForDimension(int index,
int... dimension)
A copy of this operation for a particular dimension of the input
|
Op |
opForDimension(int index,
int dimension)
A copy of this operation for a particular dimension of the input
|
int |
opNum()
An op number
|
static int |
reductionIndexForLinear(int i,
int elementWiseStride,
int numElementsPerTad,
int tadNum,
int originalTadNum)
Maps a linear index to a reduction index
|
static int |
reductionIndexForTad(int tadIndexForOriginal,
int tadsForReduced,
int tadsForOriginal)
Map a tad to a
reduction index.
|
static int |
tadIndex(int i,
int elementWiseStride,
int numElementsPerTad)
Given an linear index, element wise stride
and the length of each tad
map a linear index to a tad
|
static int |
tadsPerReduceIndex(int tadsForReduce,
int tadsForOriginal)
Computes the number of tads
per reduce index for the
reduction tad.
|
INDArray |
x()
The origin ndarray
|
INDArray |
y()
The pairwise op ndarray
|
INDArray |
z()
The resulting ndarray
|
extraArgs, extraArgsBuff, extraArgsDataBuff, getOpType, init, isExecSpecial, n, numProcessed, setN, setX, setY, setZ, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setExtraArgs
protected Op accum
protected boolean performSmallerDimension
protected int[] smallerDimension
protected int[] originalDimension
protected int tadsForSmallerDimension
protected int tadsForLargerDimension
public static final String DEFAULT_NAME
public TadCollapseAccumulation()
public TadCollapseAccumulation(Op accum, int[] originalDimension, int[] smallerDimension, boolean performSmallerDimension)
accum
- the operation to accumulateoriginalDimension
- the bigger problemsmallerDimension
- the smaller problempublic TadCollapseAccumulation(Op accum, int[] originalDimension, int[] smallerDimension)
accum
- the operation to accumulateoriginalDimension
- the bigger problemsmallerDimension
- the smaller problempublic TadCollapseAccumulation(Op accum, int[] originalDimension)
public TadCollapseAccumulation(Op accum)
public TadCollapseAccumulation(INDArray x, INDArray y, INDArray z, long n, Op accum)
public Op getAccum()
public boolean isPassThrough()
Op
isPassThrough
in interface Op
isPassThrough
in class BaseOp
public void exec()
Op
public void exec(int... dimensions)
Op
public int opNum()
Op
public String name()
Op
public IComplexNumber op(IComplexNumber origin, double other)
Op
origin
- the origin numberother
- the other numberpublic IComplexNumber op(IComplexNumber origin, float other)
Op
origin
- the origin numberother
- the other numberpublic IComplexNumber op(IComplexNumber origin, IComplexNumber other)
Op
origin
- the origin numberother
- the other numberpublic float op(float origin, float other)
Op
origin
- the origin numberother
- the other numberpublic double op(double origin, double other)
Op
origin
- the origin numberother
- the other numberpublic double op(double origin)
Op
origin
- the origin elementpublic float op(float origin)
Op
origin
- the origin elementpublic IComplexNumber op(IComplexNumber origin)
Op
origin
- the origin elementpublic Op opForDimension(int index, int dimension)
Op
index
- the index of the op to iterate overdimension
- the dimension to ge the input forpublic Op opForDimension(int index, int... dimension)
Op
index
- the index of the op to iterate overdimension
- the dimension to ge the input forpublic static int tadIndex(int i, int elementWiseStride, int numElementsPerTad)
i
- the index to mapelementWiseStride
- the element wise stride for the tadsnumElementsPerTad
- the number of elements
per tadpublic static int reductionIndexForTad(int tadIndexForOriginal, int tadsForReduced, int tadsForOriginal)
tadIndexForOriginal
- the original tad index for the
split up problem (eg: split is dimension 3 mapping to a 2,3 problem)tadsForReduced
- the number of tads for the shrunk down problem (eg: 2,3)tadsForOriginal
- the number of tads for the smaller problem (eg: 3)public static int tadsPerReduceIndex(int tadsForReduce, int tadsForOriginal)
public static int reductionIndexForLinear(int i, int elementWiseStride, int numElementsPerTad, int tadNum, int originalTadNum)
i
- the linear index to mapelementWiseStride
- the element wise stride
for the multiple problemtadNum
- the number of tads for the shrunken problemoriginalTadNum
- the tad number for the reduced version of the problemCopyright © 2017. All rights reserved.