Skip to content

Commit c03a713

Browse files
committed
Auto-generated commit
1 parent 61286dc commit c03a713

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
### Features
1212

13+
- [`569131f`](https://github.com/stdlib-js/stdlib/commit/569131f478009cf40b7c3810ac6b1a084634283d) - update `ndarray/base` TypeScript declarations [(#11149)](https://github.com/stdlib-js/stdlib/pull/11149)
1314
- [`4b2a4ab`](https://github.com/stdlib-js/stdlib/commit/4b2a4ab1c67f6ce6df86e03c93f3d7ccd9382b70) - update `ndarray` TypeScript declarations [(#11150)](https://github.com/stdlib-js/stdlib/pull/11150)
1415
- [`475f496`](https://github.com/stdlib-js/stdlib/commit/475f4962d86ed3c562800dce759c958a52e6a15e) - add `ones` to namespace
1516
- [`ded14cf`](https://github.com/stdlib-js/stdlib/commit/ded14cff1642c79ac122cc05b65e911cc24ec2ac) - add `ndarray/ones`
@@ -810,6 +811,7 @@ A total of 44 issues were closed in this release:
810811

811812
<details>
812813

814+
- [`569131f`](https://github.com/stdlib-js/stdlib/commit/569131f478009cf40b7c3810ac6b1a084634283d) - **feat:** update `ndarray/base` TypeScript declarations [(#11149)](https://github.com/stdlib-js/stdlib/pull/11149) _(by stdlib-bot)_
813815
- [`4b2a4ab`](https://github.com/stdlib-js/stdlib/commit/4b2a4ab1c67f6ce6df86e03c93f3d7ccd9382b70) - **feat:** update `ndarray` TypeScript declarations [(#11150)](https://github.com/stdlib-js/stdlib/pull/11150) _(by stdlib-bot)_
814816
- [`475f496`](https://github.com/stdlib-js/stdlib/commit/475f4962d86ed3c562800dce759c958a52e6a15e) - **feat:** add `ones` to namespace _(by Athan Reines)_
815817
- [`ded14cf`](https://github.com/stdlib-js/stdlib/commit/ded14cff1642c79ac122cc05b65e911cc24ec2ac) - **feat:** add `ndarray/ones` _(by Athan Reines)_

base/docs/types/index.d.ts

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ import numel = require( './../../../base/numel' );
121121
import numelDimension = require( './../../../base/numel-dimension' );
122122
import offset = require( './../../../base/offset' );
123123
import ones = require( './../../../base/ones' );
124+
import onesLike = require( './../../../base/ones-like' );
124125
import order = require( './../../../base/order' );
125126
import outputDataType = require( './../../../base/output-dtype' );
126127
import outputPolicyEnum2Str = require( './../../../base/output-policy-enum2str' );
@@ -3183,6 +3184,37 @@ interface Namespace {
31833184
*/
31843185
ones: typeof ones;
31853186

3187+
/**
3188+
* Creates a ones-filled array having the same shape and data type as a provided input ndarray.
3189+
*
3190+
* @param x - input array
3191+
* @returns ones-filled array
3192+
*
3193+
* @example
3194+
* var getShape = require( './../../../shape' );
3195+
* var getDType = require( './../../../dtype' );
3196+
* var ones = require( './../../../base/ones' );
3197+
*
3198+
* var x = ones( 'float64', [ 2, 2 ], 'row-major' );
3199+
* // returns <ndarray>[ [ 1.0, 1.0 ], [ 1.0, 1.0 ] ]
3200+
*
3201+
* var sh = getShape( x );
3202+
* // returns [ 2, 2 ]
3203+
*
3204+
* var dt = String( getDType( x ) );
3205+
* // returns 'float64'
3206+
*
3207+
* var y = ns.onesLike( x );
3208+
* // returns <ndarray>[ [ 1.0, 1.0 ], [ 1.0, 1.0 ] ]
3209+
*
3210+
* sh = getShape( y );
3211+
* // returns [ 2, 2 ]
3212+
*
3213+
* dt = String( getDType( y ) );
3214+
* // returns 'float64'
3215+
*/
3216+
onesLike: typeof onesLike;
3217+
31863218
/**
31873219
* Returns the layout order of a provided ndarray.
31883220
*
@@ -5435,23 +5467,23 @@ interface Namespace {
54355467
* var getDType = require( './../../../dtype' );
54365468
* var zeros = require( './../../../base/zeros' );
54375469
*
5438-
* var x = zeros( 'generic', [ 2, 2 ], 'row-major' );
5439-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
5470+
* var x = zeros( 'float64', [ 2, 2 ], 'row-major' );
5471+
* // returns <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
54405472
*
54415473
* var sh = getShape( x );
54425474
* // returns [ 2, 2 ]
54435475
*
54445476
* var dt = String( getDType( x ) );
5445-
* // returns 'generic'
5477+
* // returns 'float64'
54465478
*
54475479
* var y = ns.zerosLike( x );
5448-
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
5480+
* // returns <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
54495481
*
54505482
* sh = getShape( y );
54515483
* // returns [ 2, 2 ]
54525484
*
54535485
* dt = String( getDType( y ) );
5454-
* // returns 'generic'
5486+
* // returns 'float64'
54555487
*/
54565488
zerosLike: typeof zerosLike;
54575489

0 commit comments

Comments
 (0)