public class CompareAndReplace extends BaseTransformOp
extraArgs, extraArgz, n, numProcessed, passThrough, x, y, z
Constructor and Description |
---|
CompareAndReplace() |
CompareAndReplace(INDArray x,
INDArray y,
Condition condition)
With this constructor, op will check each X element against given Condition, and if condition met, element Z will be set to Y value, and X otherwise
PLEASE NOTE: X will be modified inplace.
|
CompareAndReplace(INDArray x,
INDArray y,
INDArray z,
Condition condition)
With this constructor, op will check each X element against given Condition, and if condition met, element Z will be set to Y value, and X otherwise
Pseudocode:
z[i] = condition(x[i]) ? y[i] : x[i];
|
Modifier and Type | Method and Description |
---|---|
void |
init(INDArray x,
INDArray y,
INDArray z,
long n)
Initialize the operation based on the parameters
|
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
|
derivative
exec, exec, extraArgs, extraArgsBuff, extraArgsDataBuff, getOpType, isExecSpecial, isPassThrough, n, numProcessed, setN, setX, setY, setZ, toString, x, y, z
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
exec, exec, extraArgs, extraArgsBuff, extraArgsDataBuff, isExecSpecial, isPassThrough, n, numProcessed, setExtraArgs, setN, setX, setY, setZ, x, y, z
public CompareAndReplace()
public CompareAndReplace(INDArray x, INDArray y, Condition condition)
x
- y
- condition
- public CompareAndReplace(INDArray x, INDArray y, INDArray z, Condition condition)
x
- y
- z
- condition
- 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)
index
- the index of the op to iterate overdimension
- the dimension to ge the input forpublic Op opForDimension(int index, int... dimension)
index
- the index of the op to iterate overdimension
- the dimension to ge the input forCopyright © 2017. All rights reserved.