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
@@ -79,31 +80,6 @@ function types2enums( types ) {
79
80
returnout;
80
81
}
81
82
82
-
/**
83
-
* 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.
84
-
*
85
-
* @private
86
-
* @param {Array<ndarray>} arrays - list of input ndarrays
87
-
* @param {ndarray} output - output ndarray
88
-
* @returns {Array<ndarray>} reordered list
89
-
*/
90
-
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
91
-
varout;
92
-
vari;
93
-
varj;
94
-
95
-
out=[];
96
-
for(i=0,j=0;i<=arrays.length;i++){
97
-
if(i===1){
98
-
out.push(output);
99
-
}else{
100
-
out.push(arrays[j]);
101
-
j+=1;
102
-
}
103
-
}
104
-
returnout;
105
-
}
106
-
107
83
108
84
// MAIN //
109
85
@@ -402,7 +378,7 @@ setReadOnly( UnaryStrided1dDispatchBy.prototype, 'apply', function apply( x ) {
// Check whether we need to reinsert singleton dimensions which can be useful for broadcasting the returned output array to the shape of the original input array...
408
384
if(opts.keepdims){
@@ -589,7 +565,7 @@ setReadOnly( UnaryStrided1dDispatchBy.prototype, 'assign', function assign( x )
589
565
f=this._table.default;
590
566
}
591
567
// Perform the reduction:
592
-
unaryReduceStrided1dBy(f,reorder(args,y),opts.dims,clbk,thisArg);// note: we assume that this lower-level function handles further validation of the output ndarray (e.g., expected shape, etc)
568
+
unaryReduceStrided1dBy(f,insertAt(args,1,y),opts.dims,clbk,thisArg);// note: we assume that this lower-level function handles further validation of the output ndarray (e.g., expected shape, etc)
0 commit comments