File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -461,19 +461,13 @@ impl Value {
461
461
}
462
462
} ;
463
463
let mut new_shape = bytes. shape ;
464
- if new_shape. is_empty ( ) {
465
- new_shape. push ( 1 ) ;
466
- }
467
- if new_shape. len ( ) > 1 {
468
- let last_dim = new_shape. pop ( ) . unwrap ( ) ;
464
+ if let Some ( last_dim) = new_shape. pop ( ) {
469
465
if last_dim != elem_size {
470
466
return Err ( env. error ( format ! (
471
467
"Bytes shape has last axis size {last_dim}, \
472
468
which does not match format {format}"
473
469
) ) ) ;
474
470
}
475
- } else {
476
- new_shape[ 0 ] = ( new_shape[ 0 ] / elem_size) . max ( 1 ) ;
477
471
}
478
472
let mut data = eco_vec ! [ 0.0 ; new_shape. elements( ) ] ;
479
473
let slice = data. make_mut ( ) ;
Original file line number Diff line number Diff line change @@ -312,9 +312,10 @@ F ← ⊂0 [⊙⊙∘]
312
312
⍤⤙≍ ¯3 ∨ 3 ¯∞
313
313
314
314
# Bytes
315
- ⍤⤙≍ ⊃⋅¤ ⍜bytes∘ "u32" 6
316
- ⍤⤙≍ ⊃⋅¤ ⍜bytes∘ "f64" 6
315
+ ⍤⤙≍ ⤙ ⍜bytes∘ "u32" 6
316
+ ⍤⤙≍ ⤙ ⍜bytes∘ "f64" 6
317
317
⍤⤙≍ ⤙⍜bytes∘ "u32" [6]
318
318
⍤⤙≍ ⤙⍜bytes∘ "f64" [6]
319
319
⍤⤙≍ ⤙⍜bytes∘ "u32" [1 2 3]
320
- ⍤⤙≍ [1 2 3 4] ⌝bytes "u32" [1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0]
320
+ ⍤⤙≍ [1 2 3 4] ⌝bytes "u32" [[1 0 0 0] [2 0 0 0] [3 0 0 0] [4 0 0 0]]
321
+ ⍤⤙≍ 6 ⌝bytes "f64" [0 0 0 0 0 0 24 64]
You can’t perform that action at this time.
0 commit comments