org.nd4j.linalg.ops
Class BaseTwoArrayElementWiseOp
- java.lang.Object
-
- org.nd4j.linalg.ops.BaseElementWiseOp
-
- org.nd4j.linalg.ops.BaseTwoArrayElementWiseOp
-
- All Implemented Interfaces:
- ElementWiseOp, TwoArrayElementWiseOp
- Direct Known Subclasses:
- AddOp, DivideOp, MultiplyOp, SubtractOp
public abstract class BaseTwoArrayElementWiseOp extends BaseElementWiseOp implements TwoArrayElementWiseOp
Apply an operation and save it to a resulting matrix
-
-
Constructor Summary
Constructors Constructor and Description BaseTwoArrayElementWiseOp()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Objectapply(INDArray origin, java.lang.Object value, int i)The transformation for a given valuevoidapplyTransformToDestination(INDArray from, INDArray destination, INDArray other, int i)Apply the function from to the specified index in to.voidexec()Executes the operation across the matrixjava.lang.ObjectgetOther(INDArray other, int i)Returns the element in destination at index iINDArrayto()The output matrix-
Methods inherited from class org.nd4j.linalg.ops.BaseElementWiseOp
applyTransformToOrigin, applyTransformToOrigin, from, getFromOrigin, getThreads
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nd4j.linalg.ops.ElementWiseOp
applyTransformToOrigin, applyTransformToOrigin, from, getFromOrigin
-
-
-
-
Method Detail
-
applyTransformToDestination
public void applyTransformToDestination(INDArray from, INDArray destination, INDArray other, int i)
Apply the function from to the specified index in to. The value from to is passed in to apply and then a transform of the matching elements in both from and to are used for a transformation. If a scalar is specified, this will apply a scalar wise operation based on the scalar and the origin matrix instead- Specified by:
applyTransformToDestinationin interfaceTwoArrayElementWiseOp- Parameters:
i- the index to apply tofrom- the origin ndarraydestination- the destination ndarrayother- the other ndarray
-
exec
public void exec()
Executes the operation across the matrix- Specified by:
execin interfaceElementWiseOp- Specified by:
execin interfaceTwoArrayElementWiseOp- Overrides:
execin classBaseElementWiseOp
-
getOther
public java.lang.Object getOther(INDArray other, int i)
Returns the element in destination at index i- Specified by:
getOtherin interfaceTwoArrayElementWiseOp- Parameters:
i- the index of the element to retrieveother- the destination ndarray- Returns:
- the element at index i
-
apply
public java.lang.Object apply(INDArray origin, java.lang.Object value, int i)
The transformation for a given value- Specified by:
applyin interfaceElementWiseOp- Parameters:
value- the value to applyTransformToOriginorigin- the origin ndarrayi- the index of the element being acted upon- Returns:
- the transformed value based on the input
-
to
public INDArray to()
The output matrix- Specified by:
toin interfaceTwoArrayElementWiseOp- Returns:
-
-
DMelt 3.0 © DataMelt by jWork.ORG