use of org.nd4j.linalg.api.ops.impl.accum.Min in project nd4j by deeplearning4j.
the class CudaAccumTests method testDimensionMax.
@Test
public void testDimensionMax() {
INDArray linspace = Nd4j.linspace(1, 6, 6).reshape('f', 2, 3);
int axis = 0;
INDArray row = linspace.slice(axis);
System.out.println("Linspace: " + linspace);
System.out.println("Row: " + row);
System.out.println("Row shapeInfo: " + row.shapeInfoDataBuffer());
Max max = new Max(row);
double max2 = Nd4j.getExecutioner().execAndReturn(max).getFinalResult().doubleValue();
assertEquals(5.0, max2, 1e-1);
Min min = new Min(row);
double min2 = Nd4j.getExecutioner().execAndReturn(min).getFinalResult().doubleValue();
assertEquals(1.0, min2, 1e-1);
}