Search in sources :

Example 1 with Mmul

use of org.nd4j.linalg.api.ops.impl.accum.Mmul in project nd4j by deeplearning4j.

the class Nd4jTestsC method testMmulOp.

@Test
public void testMmulOp() {
    INDArray arr = Nd4j.create(new double[][] { { 1, 2, 3 }, { 4, 5, 6 } });
    INDArray z = Nd4j.create(2, 2);
    INDArray assertion = Nd4j.create(new double[][] { { 14, 32 }, { 32, 77 } });
    MMulTranspose mMulTranspose = MMulTranspose.builder().transposeB(true).a(arr).b(arr).build();
    DynamicCustomOp op = new Mmul(arr, arr, z, mMulTranspose);
    Nd4j.getExecutioner().exec(op);
    assertEquals(getFailureMessage(), assertion, z);
}
Also used : Mmul(org.nd4j.linalg.api.ops.impl.accum.Mmul) INDArray(org.nd4j.linalg.api.ndarray.INDArray) DynamicCustomOp(org.nd4j.linalg.api.ops.DynamicCustomOp) MMulTranspose(org.nd4j.linalg.api.blas.params.MMulTranspose) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 MMulTranspose (org.nd4j.linalg.api.blas.params.MMulTranspose)1 INDArray (org.nd4j.linalg.api.ndarray.INDArray)1 DynamicCustomOp (org.nd4j.linalg.api.ops.DynamicCustomOp)1 Mmul (org.nd4j.linalg.api.ops.impl.accum.Mmul)1