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
throw new TypeError( format( 'invalid argument. First argument must be an ndarray-like object. Value: `%s`.', x ) );
468
463
}
469
-
if ( nargs < 3 ) {
470
-
throw new TypeError( format( 'invalid argument. Third argument must be an ndarray-like object. Value: `%s`.', out ) );
464
+
if ( !isndarrayLike( out ) ) {
465
+
throw new TypeError( format( 'invalid argument. Second argument must be an ndarray-like object having the generic data type. Value: `%s`.', out ) );
471
466
}
472
467
// Resolve input ndarray meta data:
473
468
ord = getOrder( x );
474
469
475
-
if ( getDType( out ) !== 'generic' ) <spanclass="branch-0 cbranch-no" title="branch not covered" >{</span>
476
-
<spanclass="cstat-no" title="statement not covered" > throw new TypeError( format( 'invalid argument. Third argument must be an ndarray-like object having the generic data type. Value: `%s`.', out ) );</span>
477
-
<spanclass="cstat-no" title="statement not covered" > }</span>
470
+
// Initialize the separator:
471
+
s = ',';
478
472
479
473
// Initialize an options object:
480
474
opts = {
481
475
'dims': [ -1 ] // default behavior is to perform a reduction over the last dimension
482
476
};
483
477
484
-
if ( nargs > 3 ) {
478
+
if ( nargs > 2 ) {
485
479
if ( !isPlainObject( options ) ) {
486
480
throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
// Broadcast the separator to match the shape of the non-reduced dimensions...
501
-
if ( isndarrayLike( separator ) ) {
502
-
if ( getDType( separator ) !== 'generic' ) <spanclass="branch-0 cbranch-no" title="branch not covered" >{</span>
503
-
<spanclass="cstat-no" title="statement not covered" > throw new TypeError( format( 'invalid argument. Second argument must have a generic data type. Value: `%s`.', separator ) );</span>
498
+
if ( isndarrayLike( s ) ) {
499
+
if ( getDType( s ) !== 'generic' ) <spanclass="branch-0 cbranch-no" title="branch not covered" >{</span>
500
+
<spanclass="cstat-no" title="statement not covered" > throw new TypeError( format( 'invalid argument. Second argument must have a generic data type. Value: `%s`.', s ) );</span>
504
501
<spanclass="cstat-no" title="statement not covered" > }</span>
505
-
s = maybeBroadcastArray( separator, sh );
502
+
s = maybeBroadcastArray( s, sh );
506
503
} else {
507
-
s = broadcastScalar( separator, 'generic', sh, ord );
* @param {IntegerArray} [options.dims] - list of dimensions over which to perform operation
321
+
* @param {boolean} [options.keepdims=false] - boolean indicating whether the reduced dimensions should be included in the returned ndarray as singleton dimensions
322
+
* @param {*} [options.dtype] - output ndarray data type
317
323
* @throws {TypeError} first argument must be an ndarray-like object
318
324
* @throws {TypeError} second argument must be either an ndarray-like object
319
325
* @throws {TypeError} options argument must be an object
0 commit comments