public static long numVectors ( INDArray arr ) { if ( arr . rank ( ) == 1 ) return 1 ; else if ( arr . rank ( ) == 2 ) return arr . size ( 0 ) ; else { int prod = 1 ; for ( int i = 0 ; i < arr . rank ( ) - 1 ; i ++ ) { prod *= arr . size ( i ) ; } return prod ; } }
Return the number of vectors for an array the number of vectors for an array