We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
val
fill
1 parent e29685e commit bd30f85Copy full SHA for bd30f85
dpnp/dpnp_algo/dpnp_fill.py
@@ -24,6 +24,8 @@
24
# THE POSSIBILITY OF SUCH DAMAGE.
25
# *****************************************************************************
26
27
+from numbers import Number
28
+
29
import dpctl.tensor as dpt
30
import dpctl.utils as dpu
31
from dpctl.tensor._ctors import _cast_fill_val
@@ -58,9 +60,9 @@ def dpnp_fill(arr, val):
58
60
)
59
61
_manager.add_event_pair(h_ev, c_ev)
62
return
- elif not dpnp.isscalar(val):
63
+ elif not isinstance(val, Number):
64
raise TypeError(
- f"Expected `val` to be a 0D-array or Python scalar, got {type(val)}"
65
+ f"Array cannot be filled with `val` of type {type(val)}"
66
67
68
dt = arr.dtype
0 commit comments