protected static void validateConcat ( int dimension , INDArray ... arrs ) { if ( arrs [ 0 ] . isScalar ( ) ) { for ( int i = 1 ; i < arrs . length ; i ++ ) if ( ! arrs [ i ] . isScalar ( ) ) throw new IllegalArgumentException ( "All arrays must have same dimensions" ) ; } else { int dims = arrs [ 0 ] . shape ( ) . length ; long [ ] shape = ArrayUtil . removeIndex ( arrs [ 0 ] . shape ( ) , dimension ) ; for ( int i = 1 ; i < arrs . length ; i ++ ) { assert Arrays . equals ( shape , ArrayUtil . removeIndex ( arrs [ i ] . shape ( ) , dimension ) ) ; assert arrs [ i ] . shape ( ) . length == dims ; } } }
input arrays must have same number of dimensions