Ejemplo n.º 1
0
 @Test
 public void testInnerProducts() {
   INDArray a = Array.newArray(1, 1, 1);
   INDArray b = Array.newArray(1, 1, 1);
   a.fill(2);
   b.fill(3);
   INDArray c = a.innerProduct(b);
   assertEquals(1, c.elementCount());
   assertEquals(4, c.dimensionality());
   assertEquals(6.0, c.get(0, 0, 0, 0), 0.0);
 }
Ejemplo n.º 2
0
 @Test
 public void testTranspose() {
   INDArray m = Arrayz.parse("[[[1.0,2.0],[0.0,0.0]],[[0.0,0.0],[0.0,1.0]]]");
   INDArray n = Arrayz.parse("[[[1.0,0.0],[0.0,0.0]],[[2.0,0.0],[0.0,1.0]]]");
   assertEquals(m, n.getTranspose());
 }