Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

The in-place elementwise operator cannot operate on the largest dtype for the second value. #1757

Copy link
Copy link
@npolina4

Description

@npolina4
Issue body actions

The in-place elementwise operator cannot operate on the largest dtype for the second value.

>>> import dpctl.tensor as dpt
>>> a = dpt.asarray(10, dtype="f4", device="cpu")
>>> b = dpt.asarray(5, dtype="f8", device="cpu")
>>> a += b
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "dpctl/tensor/_usmarray.pyx", line 1412, in dpctl.tensor._usmarray.usm_ndarray.__iadd__
  File "path_to_dpctl/dpctl/tensor/_elementwise_common.py", line 652, in __call__
    raise ValueError(
ValueError: Output array of type float64 is needed,got float32
>>> import numpy
>>> a = numpy.asarray(10, dtype="f4")
>>> b = numpy.asarray(5, dtype="f8")
>>> a += b
>>> a
array(15., dtype=float32)
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.