Skip to content

Commit e9953f5

Browse files
committed
nan_to_num always returns dpnp_array
1 parent 9dd3e60 commit e9953f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dpnp/dpnp_iface_mathematical.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3128,7 +3128,7 @@ def nan_to_num(x, copy=True, nan=0.0, posinf=None, neginf=None):
31283128
x_type = x.dtype.type
31293129

31303130
if not issubclass(x_type, dpnp.inexact):
3131-
return dpnp.copy(x) if copy else x
3131+
return dpnp.copy(x) if copy else dpnp.get_result_array(x)
31323132

31333133
max_f, min_f = _get_max_min(x.real.dtype)
31343134
if posinf is not None:
@@ -3165,7 +3165,7 @@ def nan_to_num(x, copy=True, nan=0.0, posinf=None, neginf=None):
31653165

31663166
_manager.add_event_pair(h_ev, comp_ev)
31673167

3168-
return dpnp.get_result_array(out) if copy else x
3168+
return dpnp.get_result_array(out)
31693169

31703170

31713171
_NEGATIVE_DOCSTRING = """

0 commit comments

Comments
 (0)