nl_tokens: Computes the shape of the largest possible <b > contiguous< / b > chunk starting at { @link #getCurrentCounter () } and with { @code numElems < = maxChunkElems } .
pl_tokens: public int [ ] computeChunkShape ( long maxChunkElems ) { int [ ] chunkShape = new int [ rank ] ; for ( int iDim = 0 ; iDim < rank ; ++ iDim ) { int size = ( int ) ( maxChunkElems / stride [ iDim ] ) ; size = ( size == 0 ) ? 1 : size ; size = Math . <mask> ( size , shape [ iDim ] - current [ iDim ] ) ; chunkShape [ iDim ] = size ; } return chunkShape ; }