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 {
461461 }
462462 } ;
463463 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 ( ) {
469465 if last_dim != elem_size {
470466 return Err ( env. error ( format ! (
471467 "Bytes shape has last axis size {last_dim}, \
472468 which does not match format {format}"
473469 ) ) ) ;
474470 }
475- } else {
476- new_shape[ 0 ] = ( new_shape[ 0 ] / elem_size) . max ( 1 ) ;
477471 }
478472 let mut data = eco_vec ! [ 0.0 ; new_shape. elements( ) ] ;
479473 let slice = data. make_mut ( ) ;
Original file line number Diff line number Diff line change @@ -312,9 +312,10 @@ F ← ⊂0 [⊙⊙∘]
312312⍤⤙≍ ¯3 ∨ 3 ¯∞
313313
314314# Bytes
315- ⍤⤙≍ ⊃⋅¤ ⍜bytes∘ "u32" 6
316- ⍤⤙≍ ⊃⋅¤ ⍜bytes∘ "f64" 6
315+ ⍤⤙≍ ⤙ ⍜bytes∘ "u32" 6
316+ ⍤⤙≍ ⤙ ⍜bytes∘ "f64" 6
317317⍤⤙≍ ⤙⍜bytes∘ "u32" [6]
318318⍤⤙≍ ⤙⍜bytes∘ "f64" [6]
319319⍤⤙≍ ⤙⍜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