@@ -172,7 +172,7 @@ private T[][][] populateTensor(ByteBuffer buffer, int depth, int rows, int cols)
172172 */
173173 public T readScalar () throws IOException , InvocationTargetException , InstantiationException , IllegalAccessException {
174174 if (dimensions .length != 0 ) {
175- throw new IllegalStateException ("Dataset must be 0D(Scalar)" );
175+ throw new IllegalStateException ("Dataset is not 0D(Scalar)" );
176176 }
177177 if (!dataset .hasData ()) {
178178 throw new IllegalStateException ("Dataset has no data" );
@@ -190,7 +190,7 @@ public T readScalar() throws IOException, InvocationTargetException, Instantiati
190190 */
191191 public Stream <T > streamScalar () throws IOException , InvocationTargetException , InstantiationException , IllegalAccessException {
192192 if (dimensions .length != 0 ) {
193- throw new IllegalStateException ("Dataset must be 0D(Scalar)" );
193+ throw new IllegalStateException ("Dataset is not 0D(Scalar)" );
194194 }
195195 if (!dataset .hasData ()) {
196196 throw new IllegalStateException ("Dataset has no data" );
@@ -220,7 +220,7 @@ public Stream<T> parallelStreamScalar() throws IOException, InvocationTargetExce
220220 */
221221 public T [] readVector () throws IOException , InvocationTargetException , InstantiationException , IllegalAccessException {
222222 if (dimensions .length != 1 ) {
223- throw new IllegalStateException ("Dataset must be 1D(Vector)" );
223+ throw new IllegalStateException ("Dataset is not 1D(Vector)" );
224224 }
225225 int size = dimensions [0 ];
226226 ByteBuffer buffer = readBytes (0 , (long ) elementSize * size );
@@ -235,7 +235,7 @@ public T[] readVector() throws IOException, InvocationTargetException, Instantia
235235 */
236236 public Stream <T > streamVector () {
237237 if (dimensions .length != 1 ) {
238- throw new IllegalStateException ("Dataset must be 1D(Vector)" );
238+ throw new IllegalStateException ("Dataset is not 1D(Vector)" );
239239 }
240240 return StreamSupport .stream (new VectorSpliterator (0 , dimensions [0 ], elementSize ), false );
241241 }
@@ -248,7 +248,7 @@ public Stream<T> streamVector() {
248248 */
249249 public Stream <T > parallelStreamVector () {
250250 if (dimensions .length != 1 ) {
251- throw new IllegalStateException ("Dataset must be 1D(Vector)" );
251+ throw new IllegalStateException ("Dataset is not 1D(Vector)" );
252252 }
253253 return StreamSupport .stream (new VectorSpliterator (0 , dimensions [0 ], elementSize ), true );
254254 }
@@ -264,7 +264,7 @@ public Stream<T> parallelStreamVector() {
264264 */
265265 public T [][] readMatrix () throws IOException , InvocationTargetException , InstantiationException , IllegalAccessException {
266266 if (dimensions .length != 2 ) {
267- throw new IllegalStateException ("Dataset must be 2D(Matrix)" );
267+ throw new IllegalStateException ("Dataset is not 2D(Matrix)" );
268268 }
269269 int rows = dimensions [0 ];
270270 int cols = dimensions [1 ];
@@ -280,7 +280,7 @@ public T[][] readMatrix() throws IOException, InvocationTargetException, Instant
280280 */
281281 public Stream <T []> streamMatrix () {
282282 if (dimensions .length != 2 ) {
283- throw new IllegalStateException ("Dataset must be 2D(Matrix)" );
283+ throw new IllegalStateException ("Dataset is not 2D(Matrix)" );
284284 }
285285 long rowSize = (long ) elementSize * dimensions [1 ];
286286 return StreamSupport .stream (new MatrixSpliterator (0 , dimensions [0 ], rowSize , dimensions [1 ]), false );
@@ -294,7 +294,7 @@ public Stream<T[]> streamMatrix() {
294294 */
295295 public Stream <T []> parallelStreamMatrix () {
296296 if (dimensions .length != 2 ) {
297- throw new IllegalStateException ("Dataset must be 2D(Matrix)" );
297+ throw new IllegalStateException ("Dataset is not 2D(Matrix)" );
298298 }
299299 long rowSize = (long ) elementSize * dimensions [1 ];
300300 return StreamSupport .stream (new MatrixSpliterator (0 , dimensions [0 ], rowSize , dimensions [1 ]), true );
@@ -311,7 +311,7 @@ public Stream<T[]> parallelStreamMatrix() {
311311 */
312312 public T [][][] readTensor () throws IOException , InvocationTargetException , InstantiationException , IllegalAccessException {
313313 if (dimensions .length != 3 ) {
314- throw new IllegalStateException ("Dataset must be 3D(Tensor)" );
314+ throw new IllegalStateException ("Dataset is not 3D(Tensor)" );
315315 }
316316 int depth = dimensions [0 ];
317317 int rows = dimensions [1 ];
@@ -328,7 +328,7 @@ public T[][][] readTensor() throws IOException, InvocationTargetException, Insta
328328 */
329329 public Stream <T [][]> streamTensor () {
330330 if (dimensions .length != 3 ) {
331- throw new IllegalStateException ("Dataset must be 3D(Tensor)" );
331+ throw new IllegalStateException ("Dataset is not 3D(Tensor)" );
332332 }
333333 long sliceSize = (long ) elementSize * dimensions [1 ] * dimensions [2 ];
334334 return StreamSupport .stream (new TensorSpliterator (0 , dimensions [0 ], sliceSize , dimensions [1 ], dimensions [2 ]), false );
@@ -342,7 +342,7 @@ public Stream<T[][]> streamTensor() {
342342 */
343343 public Stream <T [][]> parallelStreamTensor () {
344344 if (dimensions .length != 3 ) {
345- throw new IllegalStateException ("Dataset must be 3D(Tensor)" );
345+ throw new IllegalStateException ("Dataset is not 3D(Tensor)" );
346346 }
347347 long sliceSize = (long ) elementSize * dimensions [1 ] * dimensions [2 ];
348348 return StreamSupport .stream (new TensorSpliterator (0 , dimensions [0 ], sliceSize , dimensions [1 ], dimensions [2 ]), true );
0 commit comments