use of org.nd4j.linalg.api.ops.IndexAccumulation in project nd4j by deeplearning4j.
the class HalfOpsTests method testIndexReduce1.
@Test
public void testIndexReduce1() throws Exception {
INDArray array1 = Nd4j.create(new float[] { 0.0f, 0.0f, 0.0f, 2.0f, 2.0f, 0.0f });
int idx = ((IndexAccumulation) Nd4j.getExecutioner().exec(new IMax(array1))).getFinalResult();
assertEquals(3, idx);
}
use of org.nd4j.linalg.api.ops.IndexAccumulation in project nd4j by deeplearning4j.
the class CudaIndexReduceTests method testPinnedIMax2.
@Test
public void testPinnedIMax2() throws Exception {
// simple way to stop test if we're not on CUDA backend here
assertEquals("JcublasLevel1", Nd4j.getBlasWrapper().level1().getClass().getSimpleName());
INDArray array1 = Nd4j.create(new float[] { 6.0f, 0.1f, 2.0f, 3.0f, 7.0f, 5.0f });
int idx = ((IndexAccumulation) Nd4j.getExecutioner().exec(new IMax(array1))).getFinalResult();
System.out.println("Array1: " + array1);
assertEquals(4, idx);
}
use of org.nd4j.linalg.api.ops.IndexAccumulation in project nd4j by deeplearning4j.
the class CudaIndexReduceTests method testPinnedIMax4.
@Test
public void testPinnedIMax4() throws Exception {
// simple way to stop test if we're not on CUDA backend here
INDArray array1 = Nd4j.create(new float[] { 0.0f, 0.0f, 0.0f, 2.0f, 2.0f, 0.0f });
int idx = ((IndexAccumulation) Nd4j.getExecutioner().exec(new IMax(array1))).getFinalResult();
System.out.println("Array1: " + array1);
assertEquals(3, idx);
}
use of org.nd4j.linalg.api.ops.IndexAccumulation in project nd4j by deeplearning4j.
the class CudaIndexReduceTests method testPinnedIMin2.
@Test
public void testPinnedIMin2() throws Exception {
// simple way to stop test if we're not on CUDA backend here
assertEquals("JcublasLevel1", Nd4j.getBlasWrapper().level1().getClass().getSimpleName());
INDArray array1 = Nd4j.create(new float[] { 0.1f, 1.1f, 2.0f, 3.0f, 4.0f, 5.0f });
int idx = ((IndexAccumulation) Nd4j.getExecutioner().exec(new IMin(array1))).getFinalResult();
System.out.println("Array1: " + array1);
assertEquals(0, idx);
}
use of org.nd4j.linalg.api.ops.IndexAccumulation in project nd4j by deeplearning4j.
the class CudaIndexReduceTests method testIMaxLargeLarge.
@Test
public void testIMaxLargeLarge() throws Exception {
INDArray array1 = Nd4j.linspace(1, 1000, 12800);
int idx = ((IndexAccumulation) Nd4j.getExecutioner().exec(new IMax(array1))).getFinalResult();
assertEquals(12799, idx);
}
Aggregations