Repository navigation
feat: add blas/ext/last-index-equal - #16285
Conversation
blas/ext/base/last-index-equalblas/ext/last-index-equal
| The function has the following parameters: | ||
|
|
||
| - **x**: first input [ndarray][@stdlib/ndarray/ctor]. Must have at least one dimension. | ||
| - **y**: second input [ndarray][@stdlib/ndarray/ctor]. Must have a shape which is [broadcast-compatible][@stdlib/ndarray/base/broadcast-shapes] with the shape of the first input [ndarray][@stdlib/ndarray/ctor]. |
There was a problem hiding this comment.
FTR: the alternative to requiring that y is broadcast compat with x is for x and y to broadcast to a common shape. However, I think this is the correct decision given the behavior of the function; e.g., if x and y broadcast to a common shape, then x could be 0d, but then the returned indices would be the indices in the virtualized array which is a bit non-intuitive. If a user wants that sort of behavior, they can explicitly broadcast inputs to a common shape before calling this function.
There was a problem hiding this comment.
cc @batpigandme Tagging you here given my recent statements during office hours. Namely, broadcasting is not necessarily required between input ndarrays; although, this is the general rule for things like arithmetic operations.
Signed-off-by: Athan <kgryte@gmail.com>
Coverage Report
The above coverage report was generated for the changes in this PR. |
Resolves stdlib-js/metr-issue-tracker#1005.
Description
This pull request:
blas/ext/base/last-index-equalRelated Issues
This pull request has the following related issues:
blas/ext/last-index-equalmetr-issue-tracker#1005.Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
Primarily written by Claude Code.
@stdlib-js/reviewers