示例#1
0
  @Test
  public void testCreateFromArray() {
    INDArray[] as = new INDArray[2];
    as[0] = Vector.of(1, 2);
    as[1] = Vector.of(3, 4);

    INDArray a = Arrayz.create((Object) as);
    assertTrue(a instanceof AMatrix);
  }
示例#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());
 }
示例#3
0
 @Test
 public void testParse() {
   assertEquals(Vector.of(4, 5), Arrayz.parse("[[1, 2], [4, 5], [7, 8]]").slice(1));
 }