public static String shapeToString ( IntBuffer buffer ) { val shapeBuff = shapeOf ( buffer ) ; int rank = Shape . rank ( buffer ) ; val strideBuff = stride ( buffer ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "Rank: " + rank + "," ) ; sb . append ( "Offset: " + Shape . offset ( buffer ) + "\n" ) ; sb . append ( " Order: " + Shape . order ( buffer ) ) ; sb . append ( " Shape: [" ) ; for ( int i = 0 ; i < rank ; i ++ ) { sb . append ( shapeBuff . get ( i ) ) ; if ( i < rank - 1 ) sb . append ( "," ) ; } sb . append ( "], " ) ; sb . append ( " stride: [" ) ; for ( int i = 0 ; i < rank ; i ++ ) { sb . append ( strideBuff . get ( i ) ) ; if ( i < rank - 1 ) sb . append ( "," ) ; } sb . append ( "]" ) ; return sb . toString ( ) ; }
Prints the shape for this shape information