Skip to content

Commit 4509211

Browse files
committed
Auto-generated commit
1 parent cb89372 commit 4509211

File tree

4 files changed

+35
-10
lines changed

4 files changed

+35
-10
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,16 @@ This release closes the following issue:
10231023

10241024
<!-- /.features -->
10251025

1026+
<section class="bug-fixes">
1027+
1028+
##### Bug Fixes
1029+
1030+
- [`ad90a38`](https://github.com/stdlib-js/stdlib/commit/ad90a38e1d8eabd6476c7c086ac1f82f2742d386) - ensure correct shape and strides
1031+
1032+
</section>
1033+
1034+
<!-- /.bug-fixes -->
1035+
10261036
</details>
10271037

10281038
</section>
@@ -1083,6 +1093,16 @@ This release closes the following issue:
10831093

10841094
<!-- /.features -->
10851095

1096+
<section class="bug-fixes">
1097+
1098+
##### Bug Fixes
1099+
1100+
- [`1d0c130`](https://github.com/stdlib-js/stdlib/commit/1d0c13090eff8e9802ebd43c8628529309895b11) - ensure correct shape and strides
1101+
1102+
</section>
1103+
1104+
<!-- /.bug-fixes -->
1105+
10861106
</details>
10871107

10881108
</section>
@@ -1609,6 +1629,8 @@ A total of 13 people contributed to this release. Thank you to the following con
16091629

16101630
<details>
16111631

1632+
- [`ad90a38`](https://github.com/stdlib-js/stdlib/commit/ad90a38e1d8eabd6476c7c086ac1f82f2742d386) - **fix:** ensure correct shape and strides _(by Athan Reines)_
1633+
- [`1d0c130`](https://github.com/stdlib-js/stdlib/commit/1d0c13090eff8e9802ebd43c8628529309895b11) - **fix:** ensure correct shape and strides _(by Athan Reines)_
16121634
- [`d389d89`](https://github.com/stdlib-js/stdlib/commit/d389d8905c302347394f2df9d9553b3d02d4c759) - **feat:** add `ndarray/base/unary-strided1d` _(by Athan Reines)_
16131635
- [`4534d81`](https://github.com/stdlib-js/stdlib/commit/4534d81a85cc3b55592e807887a47c6aa233ac1b) - **docs:** update comment _(by Athan Reines)_
16141636
- [`6223529`](https://github.com/stdlib-js/stdlib/commit/62235292bcb59d6ee9a1af4418aec6afee619f6d) - **docs:** remove unused import in example _(by Athan Reines)_

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ Yaswanth Kosuru <116426380+yaswanthkosuru@users.noreply.github.com>
179179
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
180180
Yugal Kaushik <yugalkaushik14@gmail.com>
181181
Yuvi Mittal <128018763+yuvi-mittal@users.noreply.github.com>
182+
devshree-bhati <147095250+devshree-bhati@users.noreply.github.com>
182183
ditsu <170345142+ditsus@users.noreply.github.com>
183184
ekambains <bainsinbusiness@gmail.com>
184185
fadiothman22 <48636283+fadiothman22@users.noreply.github.com>

base/unary-reduce-strided1d/lib/reshape_strategy.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ function broadcast( x ) {
6464
* Returns a function which returns an ndarray view in which the singleton dimensions are removed from an input ndarray having only a single non-singleton dimension.
6565
*
6666
* @private
67+
* @param {ndarrayLike} arr - original ndarray
6768
* @param {NonNegativeInteger} index - index of the non-singleton dimension
6869
* @returns {Function} function for returning an ndarray view
6970
*/
70-
function squeeze( index ) {
71+
function squeeze( arr, index ) {
7172
return reshape;
7273

7374
/**
@@ -78,12 +79,12 @@ function squeeze( index ) {
7879
* @returns {ndarrayLike} a squeezed ndarray view
7980
*/
8081
function reshape( x ) {
81-
// NOTE: the following properties must be set in the exact same order as in `x` in order to ensure that the returned object has the same hidden shape as the input ndarray-like object...
82+
// NOTE: the following properties must be set in the exact same order as in `arr` in order to ensure that the returned object has the same hidden shape as the input ndarray-like object...
8283
return {
8384
'dtype': x.dtype,
8485
'data': x.data,
85-
'shape': [ x.shape[ index ] ],
86-
'strides': [ x.strides[ index ] ],
86+
'shape': [ arr.shape[ index ] ],
87+
'strides': [ arr.strides[ index ] ],
8788
'offset': x.offset,
8889
'order': x.order
8990
};
@@ -230,7 +231,7 @@ function strategy( x ) {
230231
break;
231232
}
232233
}
233-
return squeeze( i );
234+
return squeeze( x, i );
234235
}
235236
iox = iterationOrder( x.strides ); // +/-1
236237

base/unary-strided1d/lib/strategy.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ function broadcast( x ) {
6464
* Returns a function which returns an ndarray view in which the singleton dimensions are removed from an input ndarray having only a single non-singleton dimension.
6565
*
6666
* @private
67+
* @param {ndarrayLike} arr - original ndarray
6768
* @param {NonNegativeInteger} index - index of the non-singleton dimension
6869
* @returns {Function} function for returning an ndarray view
6970
*/
70-
function squeeze( index ) {
71+
function squeeze( arr, index ) {
7172
return reshape;
7273

7374
/**
@@ -78,12 +79,12 @@ function squeeze( index ) {
7879
* @returns {ndarrayLike} a squeezed ndarray view
7980
*/
8081
function reshape( x ) {
81-
// NOTE: the following properties must be set in the exact same order as in `x` in order to ensure that the returned object has the same hidden shape as the input ndarray-like object...
82+
// NOTE: the following properties must be set in the exact same order as in `arr` in order to ensure that the returned object has the same hidden shape as the input ndarray-like object...
8283
return {
8384
'dtype': x.dtype,
8485
'data': x.data,
85-
'shape': [ x.shape[ index ] ],
86-
'strides': [ x.strides[ index ] ],
86+
'shape': [ arr.shape[ index ] ],
87+
'strides': [ arr.strides[ index ] ],
8788
'offset': x.offset,
8889
'order': x.order
8990
};
@@ -261,7 +262,7 @@ function strategy( x ) {
261262
}
262263
}
263264
return {
264-
'input': squeeze( i ),
265+
'input': squeeze( x, i ),
265266
'output': identity
266267
};
267268
}

0 commit comments

Comments
 (0)