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
@@ -85,31 +86,6 @@ function types2enums( types ) {
85
86
returnout;
86
87
}
87
88
88
-
/**
89
-
* Reorders a list of ndarrays such that the output ndarray is the third ndarray argument when passing along to a resolved lower-level strided function.
90
-
*
91
-
* @private
92
-
* @param {Array<ndarray>} arrays - list of input ndarrays
93
-
* @param {ndarray} output - output ndarray
94
-
* @returns {Array<ndarray>} reordered list
95
-
*/
96
-
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
97
-
varout;
98
-
vari;
99
-
varj;
100
-
101
-
out=[];
102
-
for(i=0,j=0;i<=arrays.length;i++){
103
-
if(i===2){
104
-
out.push(output);
105
-
}else{
106
-
out.push(arrays[j]);
107
-
j+=1;
108
-
}
109
-
}
110
-
returnout;
111
-
}
112
-
113
89
114
90
// MAIN //
115
91
@@ -407,7 +383,7 @@ setReadOnly( BinaryStrided1dDispatch.prototype, 'apply', function apply( x, y )
// 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...
413
389
if(opts.keepdims){
@@ -597,7 +573,7 @@ setReadOnly( BinaryStrided1dDispatch.prototype, 'assign', function assign( x, y
597
573
f=this._table.default;
598
574
}
599
575
// Perform the reduction:
600
-
binaryReduceStrided1d(f,reorder(args,z),opts.dims);// note: we assume that this lower-level function handles further validation of the output ndarray (e.g., expected shape, etc)
576
+
binaryReduceStrided1d(f,insertAt(args,2,z),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