task: add broadcast class implementation#2901
Conversation
aa39048 to
1b251bf
Compare
1b251bf to
a2f50c3
Compare
|
View rendered docs @ https://intelpython.github.io/dpnp/pull/2901/index.html |
| arrays.append(arg) | ||
|
|
||
| if len(arrays) == 0: | ||
| raise TypeError("broadcast() requires at least one array") |
There was a problem hiding this comment.
What is the reason to raise the error here? I see that numpy accept that.
| arrays = [] | ||
| for arg in args: | ||
| if not isinstance(arg, dpnp.ndarray): | ||
| # Convert array-like to dpnp.ndarray |
There was a problem hiding this comment.
Conversion might be a costly operation, why do we need that?
Also, we have to allocate new arrays only on the same SYCL queue and with coerced USM type to comply with Compute follows data.
There was a problem hiding this comment.
We will probably need a conversion logic only when iterator is implemented
There was a problem hiding this comment.
Btw, we need to check that input dpnp arrays are on the same queue, something like:
exec_q = dpt.get_execution_queue(...)
if exec_q is None:
raise ExecutionPlacementError()There was a problem hiding this comment.
And also we need to check that every arg in args has .shape attribute
|
Array API standard conformance tests for dpnp=0.21.0dev0=py313h509198e_12 ran successfully. |
Adds a
broadcastclass implementation