Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Oct 8, 2023
1 parent 77db1f8 commit a2cf83f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 16 deletions.
16 changes: 11 additions & 5 deletions base/expand-dimensions/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
// MODULES //

var isReadOnly = require( './../../../base/assert/is-read-only' );
var getDType = require( './../../../base/dtype' );
var getShape = require( './../../../base/shape' );
var getStrides = require( './../../../base/strides' );
var getOffset = require( './../../../base/offset' );
var getOrder = require( './../../../base/order' );
var getData = require( './../../../base/data-buffer' );
var format = require( '@stdlib/string/format' );


Expand Down Expand Up @@ -74,9 +80,9 @@ function expandDimensions( x, axis ) {
var N;
var i;

sh = x.shape;
st = x.strides;
ord = x.order;
sh = getShape( x );
st = getStrides( x );
ord = getOrder( x );
N = sh.length;

strides = [];
Expand Down Expand Up @@ -130,11 +136,11 @@ function expandDimensions( x, axis ) {
}
if ( isReadOnly( x ) ) {
// If provided a read-only view, the returned array should also be read-only...
return new x.constructor( x.dtype, x.data, shape, strides, x.offset, x.order, { // eslint-disable-line max-len
return new x.constructor( getDType( x ), getData( x ), shape, strides, getOffset( x ), ord, { // eslint-disable-line max-len
'readonly': true
});
}
return new x.constructor( x.dtype, x.data, shape, strides, x.offset, x.order ); // eslint-disable-line max-len
return new x.constructor( getDType( x ), getData( x ), shape, strides, getOffset( x ), ord ); // eslint-disable-line max-len
}


Expand Down
3 changes: 2 additions & 1 deletion base/maybe-broadcast-array/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// MODULES //

var broadcast = require( './../../../base/broadcast-array' );
var getShape = require( './../../../base/shape' );


// MAIN //
Expand Down Expand Up @@ -88,7 +89,7 @@ function maybeBroadcastArray( arr, shape ) {
var i;

N = shape.length;
sh = arr.shape;
sh = getShape( arr );

// Check whether we need to broadcast the input array...
if ( sh.length === N ) {
Expand Down
18 changes: 12 additions & 6 deletions base/ndarraylike2object/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ var accessorSetter = require( '@stdlib/array/base/accessor-setter' );
var getter = require( '@stdlib/array/base/getter' );
var setter = require( '@stdlib/array/base/setter' );
var numel = require( './../../../base/numel' );
var getDType = require( './../../../base/dtype' );
var getShape = require( './../../../base/shape' );
var getStrides = require( './../../../base/strides' );
var getOffset = require( './../../../base/offset' );
var getOrder = require( './../../../base/order' );
var getData = require( './../../../base/data-buffer' );


// MAIN //
Expand Down Expand Up @@ -73,9 +79,9 @@ function ndarraylike2object( x ) {
var sh;
var dt;

xbuf = x.data;
sh = x.shape;
dt = x.dtype;
xbuf = getData( x );
sh = getShape( x );
dt = getDType( x );

bool = isAccessorArray( xbuf );

Expand All @@ -85,9 +91,9 @@ function ndarraylike2object( x ) {
'data': xbuf,
'length': numel( sh ),
'shape': sh,
'strides': x.strides,
'offset': x.offset,
'order': x.order,
'strides': getStrides( x ),
'offset': getOffset( x ),
'order': getOrder( x ),
'accessorProtocol': bool,
'accessors': ( bool ) ?
[ accessorGetter( dt ), accessorSetter( dt ) ] :
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit a2cf83f

Please sign in to comment.