48
48
from dpnp .dpnp_utils import *
49
49
50
50
import dpnp .dpnp_container as dpnp_container
51
+ import dpctl .tensor as dpt
51
52
52
53
53
54
__all__ = [
@@ -530,7 +531,7 @@ def empty_like(x1,
530
531
531
532
Limitations
532
533
-----------
533
- Parameters ``x1`` is supported only as :class:`dpnp.dpnp_array`.
534
+ Parameter ``x1`` is supported as :class:`dpnp.dpnp_array` or :class:`dpctl.tensor.usm_ndarray`
534
535
Parameter ``order`` is supported with values ``"C"`` or ``"F"``.
535
536
Parameter ``subok`` is supported only with default value ``False``.
536
537
Otherwise the function will be executed sequentially on CPU.
@@ -552,7 +553,7 @@ def empty_like(x1,
552
553
553
554
"""
554
555
555
- if not isinstance (x1 , dpnp .ndarray ):
556
+ if not isinstance (x1 , ( dpnp .ndarray , dpt . usm_ndarray ) ):
556
557
pass
557
558
elif order not in ('C' , 'c' , 'F' , 'f' , None ):
558
559
pass
@@ -762,7 +763,7 @@ def full_like(x1,
762
763
763
764
Limitations
764
765
-----------
765
- Parameters ``x1`` is supported only as :class:`dpnp.dpnp_array`.
766
+ Parameter ``x1`` is supported as :class:`dpnp.dpnp_array` or :class:`dpctl.tensor.usm_ndarray`
766
767
Parameter ``order`` is supported only with values ``"C"`` and ``"F"``.
767
768
Parameter ``subok`` is supported only with default value ``False``.
768
769
Otherwise the function will be executed sequentially on CPU.
@@ -783,7 +784,7 @@ def full_like(x1,
783
784
[1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
784
785
785
786
"""
786
- if not isinstance (x1 , dpnp .ndarray ):
787
+ if not isinstance (x1 , ( dpnp .ndarray , dpt . usm_ndarray ) ):
787
788
pass
788
789
elif order not in ('C' , 'c' , 'F' , 'f' , None ):
789
790
pass
@@ -1189,7 +1190,7 @@ def ones_like(x1,
1189
1190
1190
1191
Limitations
1191
1192
-----------
1192
- Parameters ``x1`` is supported only as :class:`dpnp.dpnp_array`.
1193
+ Parameter ``x1`` is supported as :class:`dpnp.dpnp_array` or :class:`dpctl.tensor.usm_ndarray`
1193
1194
Parameter ``order`` is supported with values ``"C"`` or ``"F"``.
1194
1195
Parameter ``subok`` is supported only with default value ``False``.
1195
1196
Otherwise the function will be executed sequentially on CPU.
@@ -1211,7 +1212,7 @@ def ones_like(x1,
1211
1212
[1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
1212
1213
1213
1214
"""
1214
- if not isinstance (x1 , dpnp .ndarray ):
1215
+ if not isinstance (x1 , ( dpnp .ndarray , dpt . usm_ndarray ) ):
1215
1216
pass
1216
1217
elif order not in ('C' , 'c' , 'F' , 'f' , None ):
1217
1218
pass
@@ -1502,7 +1503,7 @@ def zeros_like(x1,
1502
1503
1503
1504
Limitations
1504
1505
-----------
1505
- Parameters ``x1`` is supported only as :class:`dpnp.dpnp_array`.
1506
+ Parameter ``x1`` is supported as :class:`dpnp.dpnp_array` or :class:`dpctl.tensor.usm_ndarray`
1506
1507
Parameter ``order`` is supported with values ``"C"`` or ``"F"``.
1507
1508
Parameter ``subok`` is supported only with default value ``False``.
1508
1509
Otherwise the function will be executed sequentially on CPU.
@@ -1523,8 +1524,8 @@ def zeros_like(x1,
1523
1524
>>> [i for i in np.zeros_like(x)]
1524
1525
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
1525
1526
1526
- """
1527
- if not isinstance (x1 , dpnp .ndarray ):
1527
+ """
1528
+ if not isinstance (x1 , ( dpnp .ndarray , dpt . usm_ndarray ) ):
1528
1529
pass
1529
1530
elif order not in ('C' , 'c' , 'F' , 'f' , None ):
1530
1531
pass
0 commit comments