You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -76,31 +77,6 @@ function types2enums( types ) {
76
77
returnout;
77
78
}
78
79
79
-
/**
80
-
* Reorders a list of ndarrays such that the output ndarray is the second ndarray argument when passing along to a resolved lower-level strided function.
81
-
*
82
-
* @private
83
-
* @param {Array<ndarray>} arrays - list of input ndarrays
84
-
* @param {ndarray} output - output ndarray
85
-
* @returns {Array<ndarray>} reordered list
86
-
*/
87
-
functionreorder(arrays,output){// TODO: consider replacing with an `array/base/*` utility which expands an input array by inserting a specified value at a specified index and returns a new array
88
-
varout;
89
-
vari;
90
-
varj;
91
-
92
-
out=[];
93
-
for(i=0,j=0;i<=arrays.length;i++){
94
-
if(i===1){
95
-
out.push(output);
96
-
}else{
97
-
out.push(arrays[j]);
98
-
j+=1;
99
-
}
100
-
}
101
-
returnout;
102
-
}
103
-
104
80
105
81
// MAIN //
106
82
@@ -354,7 +330,7 @@ setReadOnly( UnaryStrided1dDispatch.prototype, 'apply', function apply( x ) {
354
330
f=this._table.default;
355
331
}
356
332
// Perform operation:
357
-
this._apply(f,reorder(args,y),opts.dims);
333
+
this._apply(f,insertAt(args,1,y),opts.dims);
358
334
359
335
returny;
360
336
});
@@ -502,7 +478,7 @@ setReadOnly( UnaryStrided1dDispatch.prototype, 'assign', function assign( x ) {
502
478
f=this._table.default;
503
479
}
504
480
// Perform operation:
505
-
this._apply(f,reorder(args,y),opts.dims);// note: we assume that this lower-level function handles further validation of the output ndarray (e.g., expected shape, etc)
481
+
this._apply(f,insertAt(args,1,y),opts.dims);// note: we assume that this lower-level function handles further validation of the output ndarray (e.g., expected shape, etc)
0 commit comments