File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -2596,11 +2596,11 @@ where
25962596 for count in usage_counts. slice ( ) {
25972597 assert_eq ! ( * count, 1 , "each axis must be listed exactly once" ) ;
25982598 }
2599-
2599+
26002600 // Create temporary arrays for the new dimensions and strides
26012601 let mut new_dim = D :: zeros ( self . ndim ( ) ) ;
26022602 let mut new_strides = D :: zeros ( self . ndim ( ) ) ;
2603-
2603+
26042604 {
26052605 let dim = self . layout . dim . slice ( ) ;
26062606 let strides = self . layout . strides . slice ( ) ;
@@ -2609,10 +2609,13 @@ where
26092609 new_strides[ new_axis] = strides[ axis] ;
26102610 }
26112611 }
2612-
2612+
26132613 // Update the dimensions and strides in place
26142614 self . layout . dim . slice_mut ( ) . copy_from_slice ( new_dim. slice ( ) ) ;
2615- self . layout . strides . slice_mut ( ) . copy_from_slice ( new_strides. slice ( ) ) ;
2615+ self . layout
2616+ . strides
2617+ . slice_mut ( )
2618+ . copy_from_slice ( new_strides. slice ( ) ) ;
26162619 }
26172620}
26182621
You can’t perform that action at this time.
0 commit comments