@Test
public void testAsRowVector() throws Exception {

    BufferedImage img1 = makeRandomBufferedImage(0, 0, 1);
    Mat img2 = makeRandomImage(0, 0, 3);
    int w1 = 35, h1 = 79, ch1 = 3;
    NativeImageLoader loader1 = new NativeImageLoader(h1, w1, ch1);
    INDArray array1 = loader1.asRowVector(img1);
    assertEquals(2, array1.rank());
    assertEquals(1, array1.rows());
    assertEquals(h1 * w1 * ch1, array1.columns());
    INDArray array2 = loader1.asRowVector(img2);
    assertEquals(2, array2.rank());
    assertEquals(1, array2.rows());
    assertEquals(h1 * w1 * ch1, array2.columns());
    int w2 = 103, h2 = 68, ch2 = 4;
    NativeImageLoader loader2 = new NativeImageLoader(h2, w2, ch2);
    INDArray array3 = loader2.asRowVector(img1);
    assertEquals(2, array3.rank());
    assertEquals(1, array3.rows());
    assertEquals(h2 * w2 * ch2, array3.columns());
    INDArray array4 = loader2.asRowVector(img2);
    assertEquals(2, array4.rank());
    assertEquals(1, array4.rows());
    assertEquals(h2 * w2 * ch2, array4.columns());
}