Skip to content

Commit ce22252

Browse files
committed
Auto-generated commit
1 parent 15f8432 commit ce22252

File tree

9 files changed

+287
-233
lines changed

9 files changed

+287
-233
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ A total of 44 issues were closed in this release:
801801

802802
<details>
803803

804+
- [`f44463a`](https://github.com/stdlib-js/stdlib/commit/f44463a257a9c70c3b0baa84168bcb1f10cd438e) - **docs:** update examples and docs to accommodate dtype instances _(by Athan Reines)_
804805
- [`9dbe58b`](https://github.com/stdlib-js/stdlib/commit/9dbe58b69db750318766dc0b96813199560135f1) - **docs:** update examples and docs to accommodate dtype instances _(by Athan Reines)_
805806
- [`b0b7d75`](https://github.com/stdlib-js/stdlib/commit/b0b7d753dfa54d45970e34fde995e77cc3e75df9) - **docs:** fix copy _(by Athan Reines)_
806807
- [`d9a5e08`](https://github.com/stdlib-js/stdlib/commit/d9a5e081c5376c8688ffd96f29dec0e135cb123c) - **docs:** update namespace table of contents [(#11114)](https://github.com/stdlib-js/stdlib/pull/11114) _(by stdlib-bot)_

base/zeros-like/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,16 @@ var zerosLike = require( '@stdlib/ndarray/base/zeros-like' );
4545
Creates a zero-filled ndarray having the same shape and [data type][@stdlib/ndarray/dtypes] as a provided ndarray.
4646

4747
```javascript
48+
var getShape = require( '@stdlib/ndarray/shape' );
4849
var zeros = require( '@stdlib/ndarray/base/zeros' );
4950

5051
var x = zeros( 'float64', [ 2, 2 ], 'row-major' );
51-
// returns <ndarray>
52+
// returns <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
5253

5354
var y = zerosLike( x );
54-
// returns <ndarray>
55+
// returns <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
5556

56-
var sh = y.shape;
57+
var sh = getShape( y );
5758
// returns [ 2, 2 ]
5859
```
5960

@@ -84,19 +85,18 @@ var sh = y.shape;
8485
```javascript
8586
var dtypes = require( '@stdlib/ndarray/dtypes' );
8687
var zeros = require( '@stdlib/ndarray/base/zeros' );
88+
var ndarray2array = require( '@stdlib/ndarray/to-array' );
8789
var zerosLike = require( '@stdlib/ndarray/base/zeros-like' );
8890

8991
// Get a list of data types:
90-
var dt = dtypes( 'numeric' );
92+
var dt = dtypes( 'integer_and_generic' );
9193

9294
// Generate zero-filled arrays...
9395
var x;
94-
var y;
9596
var i;
9697
for ( i = 0; i < dt.length; i++ ) {
97-
x = zeros( dt[ i ], [ 2, 2 ], 'row-major' );
98-
y = zerosLike( x );
99-
console.log( y.data );
98+
x = zerosLike( zeros( dt[ i ], [ 2, 2 ], 'row-major' ) );
99+
console.log( ndarray2array( x ) );
100100
}
101101
```
102102

base/zeros-like/docs/repl.txt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,9 @@
2121
Examples
2222
--------
2323
> var x = {{alias:@stdlib/ndarray/base/zeros}}( 'float64', [ 2, 2 ], 'row-major' )
24-
<ndarray>
25-
> var sh = x.shape
26-
[ 2, 2 ]
27-
> var dt = x.dtype
28-
'float64'
24+
<ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
2925
> var y = {{alias}}( x )
30-
<ndarray>
31-
> sh = y.shape
32-
[ 2, 2 ]
33-
> dt = y.dtype
34-
'float64'
26+
<ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
3527

3628
See Also
3729
--------

0 commit comments

Comments
 (0)