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)
@@ -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)
@@ -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
@@ -353,7 +329,7 @@ setReadOnly( UnaryStrided1dDispatch.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...
359
335
if(opts.keepdims){
@@ -504,7 +480,7 @@ setReadOnly( UnaryStrided1dDispatch.prototype, 'assign', function assign( x ) {
504
480
f=this._table.default;
505
481
}
506
482
// Perform the reduction:
507
-
unaryReduceStrided1d(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)
483
+
unaryReduceStrided1d(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)
@@ -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