*
*/
public class TestArrays {
private void testShape(INDArray a) {
AVector v = a.asVector();
int[] shape = a.getShape();
for (int i = 0; i < a.dimensionality(); i++) {
assertEquals(shape[i], a.getShape(i));
}
long[] longShape = a.getLongShape();
for (int i = 0; i < shape.length; i++) {
assertEquals(longShape[i], shape[i]);
}
assertEquals(a.dimensionality(), shape.length);
long r = 1;
for (int i = 0; i < shape.length; i++) {
r *= shape[i];
}
assertEquals(v.length(), r);
assertEquals(a, a.reshape(shape));
}