File tree Expand file tree Collapse file tree 1 file changed +1
-44
lines changed Expand file tree Collapse file tree 1 file changed +1
-44
lines changed Original file line number Diff line number Diff line change @@ -938,51 +938,8 @@ public int[] GetCoordinates(int offset)
938938 [ MethodImpl ( ( MethodImplOptions ) 768 ) ]
939939 public int [ ] GetCoordinatesFromAbsoluteIndex ( int offset )
940940 {
941- int [ ] coords = null ;
942941 if ( ! IsSliced )
943- {
944- if ( strides . Length == 1 )
945- coords = new int [ ] { offset } ;
946- else if ( layout == 'C' )
947- {
948- int counter = offset ;
949- coords = new int [ strides . Length ] ;
950- int stride ;
951- for ( int i = 0 ; i < strides . Length ; i ++ )
952- {
953- stride = strides [ i ] ;
954- if ( stride == 0 )
955- {
956- coords [ i ] = 0 ;
957- }
958- else
959- {
960- coords [ i ] = counter / stride ;
961- counter -= coords [ i ] * stride ;
962- }
963- }
964- }
965- else
966- {
967- int counter = offset ;
968- coords = new int [ strides . Length ] ;
969- int stride ;
970- for ( int i = strides . Length - 1 ; i >= 0 ; i -- )
971- {
972- stride = strides [ i ] ;
973- if ( stride == 0 )
974- {
975- coords [ i ] = 0 ;
976- }
977- else
978- {
979- coords [ i ] = counter / stride ;
980- counter -= coords [ i ] * stride ;
981- }
982- }
983- }
984- return coords ;
985- }
942+ return GetCoordinates ( offset ) ;
986943
987944 // handle sliced shape
988945 int [ ] parent_coords = null ;
You can’t perform that action at this time.
0 commit comments