@@ -105,37 +105,37 @@ private NDArray setValue2D<T>(NDArray indexes)
105105 {
106106 var buf = Data < T > ( ) ;
107107 var idx = indexes . Data < int > ( ) ;
108- var selectedValues = new NDArray ( dtype , new Shape ( indexes . size , shape [ 1 ] ) ) ;
108+ var nd = new NDArray ( dtype , new Shape ( indexes . size , shape [ 1 ] ) ) ;
109109
110- Parallel . For ( 0 , selectedValues . shape [ 0 ] , ( row ) =>
110+ Parallel . For ( 0 , nd . shape [ 0 ] , ( row ) =>
111111 {
112- for ( int col = 0 ; col < selectedValues . shape [ 1 ] ; col ++ )
113- selectedValues . SetData ( buf [ Storage . Shape . GetIndexInShape ( idx [ row ] , col ) ] , row , col ) ;
112+ for ( int col = 0 ; col < nd . shape [ 1 ] ; col ++ )
113+ nd . SetData ( buf [ Storage . Shape . GetIndexInShape ( idx [ row ] , col ) ] , row , col ) ;
114114 } ) ;
115115
116- return selectedValues ;
116+ return nd ;
117117 }
118118
119119 private NDArray setValue3D < T > ( NDArray indexes )
120120 {
121121 var buf = Data < T > ( ) ;
122- var selectedValues = new NDArray ( dtype , new Shape ( indexes . size , shape [ 1 ] , shape [ 2 ] ) ) ;
122+ var nd = new NDArray ( dtype , new Shape ( indexes . size , shape [ 1 ] , shape [ 2 ] ) ) ;
123123 var idx = indexes . Data < int > ( ) ;
124124
125- Parallel . For ( 0 , selectedValues . shape [ 0 ] , ( item ) =>
125+ Parallel . For ( 0 , nd . shape [ 0 ] , ( item ) =>
126126 {
127- for ( int row = 0 ; row < selectedValues . shape [ 1 ] ; row ++ )
128- for ( int col = 0 ; col < selectedValues . shape [ 2 ] ; col ++ )
129- selectedValues . SetData ( buf [ Storage . Shape . GetIndexInShape ( idx [ item ] , row , col ) ] , item , row , col ) ;
127+ for ( int row = 0 ; row < nd . shape [ 1 ] ; row ++ )
128+ for ( int col = 0 ; col < nd . shape [ 2 ] ; col ++ )
129+ nd . SetData ( buf [ Storage . Shape . GetIndexInShape ( idx [ item ] , row , col ) ] , item , row , col ) ;
130130 } ) ;
131131
132- return selectedValues ;
132+ return nd ;
133133 }
134134
135135 private NDArray setValue4D < T > ( NDArray indexes )
136136 {
137137 var buf = Data < T > ( ) ;
138- var selectedValues = new NDArray ( dtype , new Shape ( indexes . size , shape [ 1 ] , shape [ 2 ] , shape [ 3 ] ) ) ;
138+ var nd = new NDArray ( dtype , new Shape ( indexes . size , shape [ 1 ] , shape [ 2 ] , shape [ 3 ] ) ) ;
139139 var idx = indexes . Data < int > ( ) ;
140140
141141 /*
@@ -145,15 +145,15 @@ private NDArray setValue4D<T>(NDArray indexes)
145145 for (int channel = 0; channel < selectedValues.shape[3]; channel++)
146146 selectedValues.SetData(buf[Storage.Shape.GetIndexInShape(idx[item], row, col, channel)], item, row, col, channel);
147147 */
148- Parallel . For ( 0 , selectedValues . shape [ 0 ] , ( item ) =>
148+ Parallel . For ( 0 , nd . shape [ 0 ] , ( item ) =>
149149 {
150- for ( int row = 0 ; row < selectedValues . shape [ 1 ] ; row ++ )
151- for ( int col = 0 ; col < selectedValues . shape [ 2 ] ; col ++ )
152- for ( int channel = 0 ; channel < selectedValues . shape [ 3 ] ; channel ++ )
153- selectedValues . SetData ( buf [ Storage . Shape . GetIndexInShape ( idx [ item ] , row , col , channel ) ] , item , row , col , channel ) ;
150+ for ( int row = 0 ; row < nd . shape [ 1 ] ; row ++ )
151+ for ( int col = 0 ; col < nd . shape [ 2 ] ; col ++ )
152+ for ( int channel = 0 ; channel < nd . shape [ 3 ] ; channel ++ )
153+ nd . SetData ( buf [ Storage . Shape . GetIndexInShape ( idx [ item ] , row , col , channel ) ] , item , row , col , channel ) ;
154154 } ) ;
155155
156- return selectedValues ;
156+ return nd ;
157157 }
158158
159159 public NDArray this [ NDArray < bool > booleanArray ]
0 commit comments