Repository: IntelPython/dpnp

Issue:
dpnp array creations should document device, sycl_queue, usm_type keywords in docstrings
At the moment these parameters are not described.

![image](https://user-images.githubusercontent.com/21087696/201221320-141079b1-9a81-4768-a41a-727bd5cc4dda.png)



Discussion:

Resolving patch:
diff --git a/dpnp/dpnp_algo/dpnp_arraycreation.py b/dpnp/dpnp_algo/dpnp_arraycreation.py
--- a/dpnp/dpnp_algo/dpnp_arraycreation.py
+++ b/dpnp/dpnp_algo/dpnp_arraycreation.py
@@ -289,9 +289,9 @@ class dpnp_nd_grid:
     def __init__(
         self, sparse=False, device=None, usm_type="device", sycl_queue=None
     ):
-        dpu.validate_usm_type(usm_type, allow_none=False)
+        dpu.validate_usm_type(usm_type, allow_none=True)
         self.sparse = sparse
-        self.usm_type = usm_type
+        self.usm_type = "device" if usm_type is None else usm_type
         self.sycl_queue_normalized = dpnp.get_normalized_queue_device(
             sycl_queue=sycl_queue, device=device
         )
diff --git a/dpnp/dpnp_iface_arraycreation.py b/dpnp/dpnp_iface_arraycreation.py
--- a/dpnp/dpnp_iface_arraycreation.py
+++ b/dpnp/dpnp_iface_arraycreation.py
@@ -139,7 +139,7 @@ def arange(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
         Default is "device".
     sycl_queue : {None, SyclQueue}, optional
@@ -188,6 +188,9 @@ def arange(
 
     dpnp.check_limitations(like=like)
 
+    if usm_type is None:
+        usm_type = "device"
+
     return dpnp_container.arange(
         start,
         stop=stop,
@@ -239,9 +242,9 @@ def array(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
 
@@ -363,9 +366,9 @@ def asanyarray(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
 
@@ -459,9 +462,9 @@ def asarray(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
 
@@ -548,9 +551,9 @@ def ascontiguousarray(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
 
@@ -658,9 +661,9 @@ def asfortranarray(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
 
@@ -770,9 +773,9 @@ def copy(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
 
@@ -876,9 +879,9 @@ def diag(v, /, k=0, *, device=None, usm_type=None, sycl_queue=None):
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
 
@@ -992,9 +995,9 @@ def diagflat(v, /, k=0, *, device=None, usm_type=None, sycl_queue=None):
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
 
@@ -1091,7 +1094,7 @@ def empty(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
         Default is "device".
     sycl_queue : {None, SyclQueue}, optional
@@ -1140,6 +1143,10 @@ def empty(
     """
 
     dpnp.check_limitations(order=order, like=like)
+
+    if usm_type is None:
+        usm_type = "device"
+
     return dpnp_container.empty(
         shape,
         dtype=dtype,
@@ -1187,9 +1194,9 @@ def empty_like(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
 
@@ -1298,7 +1305,7 @@ def eye(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
         Default is "device".
     sycl_queue : {None, SyclQueue}, optional
@@ -1350,6 +1357,9 @@ def eye(
 
     dpnp.check_limitations(order=order, like=like)
 
+    if usm_type is None:
+        usm_type = "device"
+
     return dpnp_container.eye(
         N,
         M,
@@ -1397,7 +1407,7 @@ def frombuffer(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
         Default is "device".
     sycl_queue : {None, SyclQueue}, optional
@@ -1507,7 +1517,7 @@ def fromfile(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
         Default is "device".
     sycl_queue : {None, SyclQueue}, optional
@@ -1581,7 +1591,17 @@ def fromfile(
     )
 
 
-def fromfunction(function, shape, **kwargs):
+def fromfunction(
+    function,
+    shape,
+    *,
+    dtype=float,
+    like=None,
+    device=None,
+    usm_type="device",
+    sycl_queue=None,
+    **kwargs,
+):
     """
     Construct an array by executing a function over each coordinate.
 
@@ -1590,28 +1610,189 @@ def fromfunction(function, shape, **kwargs):
 
     For full documentation refer to :obj:`numpy.fromfunction`.
 
+    Parameters
+    ----------
+    function : callable
+        The function is called with N parameters, where N is the rank of
+        `shape`. Each parameter represents the coordinates of the array varying
+        along a specific axis. For example, if `shape` were ``(2, 2)``, then
+        the parameters would be ``array([[0, 0], [1, 1]])`` and
+        ``array([[0, 1], [0, 1]])``.
+    shape : (N,) tuple of ints
+        Shape of the output array, which also determines the shape of
+        the coordinate arrays passed to `function`.
+    dtype : data-type, optional
+        Data-type of the coordinate arrays passed to `function`.
+        Default is the default floating point data type for the device where
+        the returned array is allocated.
+    device : {None, string, SyclDevice, SyclQueue}, optional
+        An array API concept of device where the output array is created.
+        The `device` can be ``None`` (the default), an OneAPI filter selector
+        string, an instance of :class:`dpctl.SyclDevice` corresponding to
+        a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
+        or a `Device` object returned by
+        :obj:`dpnp.dpnp_array.dpnp_array.device` property.
+    usm_type : {None, "device", "shared", "host"}, optional
+        The type of SYCL USM allocation for the output array.
+        Default is "device".
+    sycl_queue : {None, SyclQueue}, optional
+        A SYCL queue to use for output array allocation and copying.
+
+    Returns
+    -------
+    out : dpnp.ndarray
+        The result of the call to `function` is passed back directly.
+        Therefore the shape of `fromfunction` is completely determined by
+        `function`.
+
     Limitations
     -----------
-    Only float64, float32, int64, int32 types are supported.
+    Parameter `like` is supported only with default value ``None``.
+    Otherwise, the function raises `NotImplementedError` exception.
+
+    Notes
+    -----
+    This uses :obj:`numpy.fromfunction` and coerces the result to a DPNP array.
+    Keywords other than `dtype` and `like` are passed to `function`.
+
+    See also
+    --------
+    :obj:`dpnp.indices` : Return an array representing the indices of a grid.
+    :obj:`dpnp.meshgrid` : Return coordinate matrices from coordinate vectors.
+
+    Examples
+    --------
+    >>> import dpnp as np
+    >>> np.fromfunction(lambda i, j: i, (2, 2), dtype=float)
+    array([[0., 0.],
+           [1., 1.]])
+
+    >>> np.fromfunction(lambda i, j: j, (2, 2), dtype=float)
+    array([[0., 1.],
+           [0., 1.]])
+
+    >>> np.fromfunction(lambda i, j: i == j, (3, 3), dtype=int)
+    array([[ True, False, False],
+           [False,  True, False],
+           [False, False,  True]])
+
+    >>> np.fromfunction(lambda i, j: i + j, (3, 3), dtype=int)
+    array([[0, 1, 2],
+           [1, 2, 3],
+           [2, 3, 4]])
+
+    Creating an array on a different device or with a specified usm_type
+
+    >>> x = np.fromfunction(lambda i, j: i - j, (3, 3)) # default case
+    >>> x.device, x.usm_type
+    (Device(level_zero:gpu:0), 'device')
+
+    >>> y = np.fromfunction(lambda i, j: i - j, (3, 3), device='cpu')
+    >>> y.device, y.usm_type
+    (Device(opencl:cpu:0), 'device')
+
+    >>> z = np.fromfunction(lambda i, j: i - j, (3, 3), usm_type="host")
+    >>> z.device, z.usm_type
+    (Device(level_zero:gpu:0), 'host')
 
     """
 
-    return call_origin(numpy.fromfunction, function, shape, **kwargs)
+    dpnp.check_limitations(like=like)
+    return asarray(
+        numpy.fromfunction(function, shape, dtype=dtype, **kwargs),
+        device=device,
+        usm_type=usm_type,
+        sycl_queue=sycl_queue,
+    )
 
 
-def fromiter(iterable, dtype, count=-1):
+def fromiter(
+    iter,
+    dtype,
+    count=-1,
+    *,
+    like=None,
+    device=None,
+    usm_type="device",
+    sycl_queue=None,
+):
     """
     Create a new 1-dimensional array from an iterable object.
 
     For full documentation refer to :obj:`numpy.fromiter`.
 
+    Parameters
+    ----------
+    iter : iterable object
+        An iterable object providing data for the array.
+    dtype : data-type
+        The data-type of the returned array.
+    count : int, optional
+        The number of items to read from *iterable*.  The default is -1,
+        which means all data is read.
+    device : {None, string, SyclDevice, SyclQueue}, optional
+        An array API concept of device where the output array is created.
+        The `device` can be ``None`` (the default), an OneAPI filter selector
+        string, an instance of :class:`dpctl.SyclDevice` corresponding to
+        a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
+        or a `Device` object returned by
+        :obj:`dpnp.dpnp_array.dpnp_array.device` property.
+    usm_type : {None, "device", "shared", "host"}, optional
+        The type of SYCL USM allocation for the output array.
+        Default is "device".
+    sycl_queue : {None, SyclQueue}, optional
+        A SYCL queue to use for output array allocation and copying.
+
+    Returns
+    -------
+    out : dpnp.ndarray
+        The output array.
+
     Limitations
     -----------
-    Only float64, float32, int64, int32 types are supported.
+    Parameter `like` is supported only with default value ``None``.
+    Otherwise, the function raises `NotImplementedError` exception.
+
+    Notes
+    -----
+    This uses :obj:`numpy.fromiter` and coerces the result to a DPNP array.
+
+    See also
+    --------
+    :obj:`dpnp.frombuffer` : Construct array from the buffer data.
+    :obj:`dpnp.fromfile` : Construct array from data in a text or binary file.
+    :obj:`dpnp.fromstring` : Construct array from the text data in a string.
+
+    Examples
+    --------
+    >>> import dpnp as np
+    >>> iterable = (a * a for a in range(5))
+    >>> np.fromiter(iterable, float)
+    array([  0.,   1.,   4.,   9.,  16.])
+
+    Creating an array on a different device or with a specified usm_type
+
+    >>> x = np.fromiter(iterable, np.int32) # default case
+    >>> x.device, x.usm_type
+    (Device(level_zero:gpu:0), 'device')
+
+    >>> y = np.fromiter(iterable, np.int32, device='cpu')
+    >>> y.device, y.usm_type
+    (Device(opencl:cpu:0), 'device')
+
+    >>> z = np.fromiter(iterable, np.int32, usm_type="host")
+    >>> z.device, z.usm_type
+    (Device(level_zero:gpu:0), 'host')
 
     """
 
-    return call_origin(numpy.fromiter, iterable, dtype, count)
+    dpnp.check_limitations(like=like)
+    return asarray(
+        numpy.fromiter(iter, dtype, count=count),
+        device=device,
+        usm_type=usm_type,
+        sycl_queue=sycl_queue,
+    )
 
 
 def fromstring(
@@ -1652,7 +1833,7 @@ def fromstring(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
         Default is "device".
     sycl_queue : {None, SyclQueue}, optional
@@ -1734,9 +1915,9 @@ def full(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
 
@@ -1837,9 +2018,9 @@ def full_like(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
 
@@ -1951,9 +2132,9 @@ def geomspace(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
     endpoint : bool, optional
@@ -2061,7 +2242,7 @@ def identity(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
         Default is "device".
     sycl_queue : {None, SyclQueue}, optional
@@ -2172,9 +2353,9 @@ def linspace(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
     endpoint : bool, optional
@@ -2249,17 +2430,67 @@ def linspace(
     )
 
 
-def loadtxt(fname, **kwargs):
+def loadtxt(
+    fname,
+    dtype=float,
+    like=None,
+    device=None,
+    usm_type="device",
+    sycl_queue=None,
+    **kwargs,
+):
     r"""
     Load data from a text file.
 
-    Each row in the text file must have the same number of values.
-
     For full documentation refer to :obj:`numpy.loadtxt`.
 
+    Parameters
+    ----------
+    fname : file, str, pathlib.Path, list of str, generator
+        File, filename, list, or generator to read. If the filename extension
+        is ``.gz`` or ``.bz2``, the file is first decompressed. Note that
+        generators must return bytes or strings. The strings in a list or
+        produced by a generator are treated as lines.
+    dtype : data-type, optional
+        Data-type of the resulting array.
+        Default is the default floating point data type for the device where
+        the returned array is allocated.
+        A structured data-type is not supported.
+    device : {None, string, SyclDevice, SyclQueue}, optional
+        An array API concept of device where the output array is created.
+        The `device` can be ``None`` (the default), an OneAPI filter selector
+        string, an instance of :class:`dpctl.SyclDevice` corresponding to
+        a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
+        or a `Device` object returned by
+        :obj:`dpnp.dpnp_array.dpnp_array.device` property.
+    usm_type : {None, "device", "shared", "host"}, optional
+        The type of SYCL USM allocation for the output array.
+        Default is "device".
+    sycl_queue : {None, SyclQueue}, optional
+        A SYCL queue to use for output array allocation and copying.
+
+    Returns
+    -------
+    out : dpnp.ndarray
+        Data read from the text file.
+
     Limitations
     -----------
-    Only float64, float32, int64, int32 types are supported.
+    Parameter `like` is supported only with default value ``None``.
+    Otherwise, the function raises `NotImplementedError` exception.
+
+    Notes
+    -----
+    This uses :obj:`numpy.loadtxt` and coerces the result to a DPNP array.
+
+    See also
+    --------
+    :obj:`dpnp.frombuffer` : Construct array from the buffer data.
+    :obj:`dpnp.fromstring` : Construct array from the text data in a string.
+    :obj:`dpnp.fromregex` : Construct an array from a text file,
+                            using regular expression parsing.
+    :obj:`dpnp.load` : Load arrays or pickled objects from files.
+    :obj:`dpnp.genfromtxt` : Load data with missing values handled as specified.
 
     Examples
     --------
@@ -2270,9 +2501,32 @@ def loadtxt(fname, **kwargs):
     array([[0., 1.],
            [2., 3.]])
 
+    Creating an array on a different device or with a specified usm_type
+
+    >>> c = StringIO("0 1\n2 3")
+    >>> x = np.loadtxt(c, dtype=np.int32) # default case
+    >>> x.device, x.usm_type
+    (Device(level_zero:gpu:0), 'device')
+
+    >>> c = StringIO("0 1\n2 3")
+    >>> y = np.loadtxt(c, dtype=np.int32, device='cpu')
+    >>> y.device, y.usm_type
+    (Device(opencl:cpu:0), 'device')
+
+    >>> c = StringIO("0 1\n2 3")
+    >>> z = np.loadtxt(c, dtype=np.int32, usm_type="host")
+    >>> z.device, z.usm_type
+    (Device(level_zero:gpu:0), 'host')
+
     """
 
-    return call_origin(numpy.loadtxt, fname, **kwargs)
+    dpnp.check_limitations(like=like)
+    return asarray(
+        numpy.loadtxt(fname, dtype=dtype, **kwargs),
+        device=device,
+        usm_type=usm_type,
+        sycl_queue=sycl_queue,
+    )
 
 
 def logspace(
@@ -2317,9 +2571,9 @@ def logspace(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
     endpoint : bool, optional
@@ -2512,7 +2766,7 @@ class MGridClass:
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
         Default is "device".
     sycl_queue : {None, SyclQueue}, optional
@@ -2585,7 +2839,7 @@ class OGridClass:
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
         Default is "device".
     sycl_queue : {None, SyclQueue}, optional
@@ -2668,7 +2922,7 @@ def ones(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
         Default is "device".
     sycl_queue : {None, SyclQueue}, optional
@@ -2724,6 +2978,9 @@ def ones(
 
     dpnp.check_limitations(order=order, like=like)
 
+    if usm_type is None:
+        usm_type = "device"
+
     return dpnp_container.ones(
         shape,
         dtype=dtype,
@@ -2771,9 +3028,9 @@ def ones_like(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
 
@@ -2913,7 +3170,7 @@ def tri(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
         Default is "device".
     sycl_queue : {None, SyclQueue}, optional
@@ -3139,9 +3396,9 @@ def vander(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
-        Default is "device".
+        Default is ``None``.
     sycl_queue : {None, SyclQueue}, optional
         A SYCL queue to use for output array allocation and copying.
 
@@ -3256,7 +3513,7 @@ def zeros(
         a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,
         or a `Device` object returned by
         :obj:`dpnp.dpnp_array.dpnp_array.device` property.
-    usm_type : {"device", "shared", "host"}, optional
+    usm_type : {None, "device", "shared", "host"}, optional
         The type of SYCL USM allocation for the output array.
         Default is "device".
     sycl_queue : {None, SyclQueue}, optional
@@ -3312,6 +3569,9 @@ def zeros(
 
     dpnp.check_limitations(order=order, like=like)
 
+    if usm_type is None:
+        usm_type = "device"
+
     return dpnp_container.zeros(
         shape,
         dtype=dtype,


Test patch:
diff --git a/tests/test_arraycreation.py b/tests/test_arraycreation.py
--- a/tests/test_arraycreation.py
+++ b/tests/test_arraycreation.py
@@ -233,7 +233,6 @@ def test_fromfile(dtype):
     assert_dtype_allclose(dpnp_res, np_res)
 
 
-@pytest.mark.usefixtures("allow_fall_back_on_numpy")
 @pytest.mark.parametrize(
     "dtype", get_all_dtypes(no_bool=True, no_float16=False)
 )
@@ -246,7 +245,6 @@ def func(x, y):
     assert_array_equal(call_func(dpnp), call_func(numpy))
 
 
-@pytest.mark.usefixtures("allow_fall_back_on_numpy")
 @pytest.mark.parametrize("dtype", get_all_dtypes(no_float16=False))
 def test_fromiter(dtype):
     _iter = [1, 2, 3, 4]
@@ -268,7 +266,6 @@ def test_identity(n, dtype):
     assert_array_equal(func(numpy), func(dpnp))
 
 
-@pytest.mark.usefixtures("allow_fall_back_on_numpy")
 @pytest.mark.parametrize("dtype", get_all_dtypes(no_float16=False))
 def test_loadtxt(dtype):
     func = lambda xp: xp.loadtxt(fh, dtype=dtype)
@@ -282,7 +279,7 @@ def test_loadtxt(dtype):
         fh.seek(0)
         dpnp_res = func(dpnp)
 
-        assert_array_equal(dpnp_res, np_res)
+    assert_array_equal(dpnp_res, np_res)
 
 
 @pytest.mark.parametrize("dtype", get_all_dtypes(no_bool=True, no_complex=True))
diff --git a/tests/test_sycl_queue.py b/tests/test_sycl_queue.py
--- a/tests/test_sycl_queue.py
+++ b/tests/test_sycl_queue.py
@@ -89,6 +89,12 @@ def vvsort(val, vec, size, xp):
         pytest.param(
             "frombuffer", [b"\x01\x02\x03\x04"], {"dtype": dpnp.int32}
         ),
+        pytest.param(
+            "fromfunction",
+            [(lambda i, j: i + j), (3, 3)],
+            {"dtype": dpnp.int32},
+        ),
+        pytest.param("fromiter", [[1, 2, 3, 4]], {"dtype": dpnp.int64}),
         pytest.param("fromstring", ["1, 2"], {"dtype": int, "sep": " "}),
         pytest.param("full", [(2, 2)], {"fill_value": 5}),
         pytest.param("eye", [4, 2], {}),
@@ -340,6 +346,26 @@ def test_array_creation_from_file(device):
     assert dpnp_array.sycl_device == device
 
 
+@pytest.mark.parametrize(
+    "device",
+    valid_devices,
+    ids=[device.filter_string for device in valid_devices],
+)
+def test_array_creation_load_txt(device):
+    with tempfile.TemporaryFile() as fh:
+        fh.write(b"1 2 3 4")
+        fh.flush()
+
+        fh.seek(0)
+        numpy_array = numpy.loadtxt(fh)
+
+        fh.seek(0)
+        dpnp_array = dpnp.loadtxt(fh, device=device)
+
+    assert_dtype_allclose(dpnp_array, numpy_array)
+    assert dpnp_array.sycl_device == device
+
+
 @pytest.mark.parametrize(
     "device_x",
     valid_devices,
diff --git a/tests/test_usm_type.py b/tests/test_usm_type.py
--- a/tests/test_usm_type.py
+++ b/tests/test_usm_type.py
@@ -195,6 +195,10 @@ def test_array_creation_from_2d_array(func, args, usm_type_x, usm_type_y):
     [
         pytest.param("arange", [-25.7], {"stop": 10**8, "step": 15}),
         pytest.param("frombuffer", [b"\x01\x02\x03\x04"], {"dtype": dp.int32}),
+        pytest.param(
+            "fromfunction", [(lambda i, j: i + j), (3, 3)], {"dtype": dp.int32}
+        ),
+        pytest.param("fromiter", [[1, 2, 3, 4]], {"dtype": dp.int64}),
         pytest.param("fromstring", ["1, 2"], {"dtype": int, "sep": " "}),
         pytest.param("full", [(2, 2)], {"fill_value": 5}),
         pytest.param("eye", [4, 2], {}),
@@ -207,7 +211,7 @@ def test_array_creation_from_2d_array(func, args, usm_type_x, usm_type_y):
         pytest.param("zeros", [(2, 2)], {}),
     ],
 )
-@pytest.mark.parametrize("usm_type", list_of_usm_types, ids=list_of_usm_types)
+@pytest.mark.parametrize("usm_type", list_of_usm_types + [None])
 def test_array_creation_from_scratch(func, arg, kwargs, usm_type):
     dpnp_kwargs = dict(kwargs)
     dpnp_kwargs["usm_type"] = usm_type
@@ -217,12 +221,29 @@ def test_array_creation_from_scratch(func, arg, kwargs, usm_type):
     numpy_kwargs["dtype"] = dpnp_array.dtype
     numpy_array = getattr(numpy, func)(*arg, **numpy_kwargs)
 
+    if usm_type is None:
+        # assert against default USM type
+        usm_type = "device"
+
     assert_dtype_allclose(dpnp_array, numpy_array)
     assert dpnp_array.shape == numpy_array.shape
     assert dpnp_array.usm_type == usm_type
 
 
-@pytest.mark.parametrize("usm_type", list_of_usm_types, ids=list_of_usm_types)
+@pytest.mark.parametrize("usm_type", list_of_usm_types + [None])
+def test_array_creation_empty(usm_type):
+    dpnp_array = dp.empty((3, 4), usm_type=usm_type)
+    numpy_array = numpy.empty((3, 4))
+
+    if usm_type is None:
+        # assert against default USM type
+        usm_type = "device"
+
+    assert dpnp_array.shape == numpy_array.shape
+    assert dpnp_array.usm_type == usm_type
+
+
+@pytest.mark.parametrize("usm_type", list_of_usm_types + [None])
 def test_array_creation_from_file(usm_type):
     with tempfile.TemporaryFile() as fh:
         fh.write(b"\x00\x01\x02\x03\x04\x05\x06\x07\x08")
@@ -234,6 +255,31 @@ def test_array_creation_from_file(usm_type):
         fh.seek(0)
         dpnp_array = dp.fromfile(fh, usm_type=usm_type)
 
+    if usm_type is None:
+        # assert against default USM type
+        usm_type = "device"
+
+    assert_dtype_allclose(dpnp_array, numpy_array)
+    assert dpnp_array.shape == numpy_array.shape
+    assert dpnp_array.usm_type == usm_type
+
+
+@pytest.mark.parametrize("usm_type", list_of_usm_types + [None])
+def test_array_creation_load_txt(usm_type):
+    with tempfile.TemporaryFile() as fh:
+        fh.write(b"1 2 3 4")
+        fh.flush()
+
+        fh.seek(0)
+        numpy_array = numpy.loadtxt(fh)
+
+        fh.seek(0)
+        dpnp_array = dp.loadtxt(fh, usm_type=usm_type)
+
+    if usm_type is None:
+        # assert against default USM type
+        usm_type = "device"
+
     assert_dtype_allclose(dpnp_array, numpy_array)
     assert dpnp_array.shape == numpy_array.shape
     assert dpnp_array.usm_type == usm_type
@@ -674,10 +720,14 @@ def test_indices(usm_type):
     assert x.usm_type == usm_type
 
 
-@pytest.mark.parametrize("usm_type", list_of_usm_types, ids=list_of_usm_types)
+@pytest.mark.parametrize("usm_type", list_of_usm_types + [None])
 @pytest.mark.parametrize("func", ["mgrid", "ogrid"])
 def test_grid(usm_type, func):
-    assert getattr(dp, func)(usm_type=usm_type)[0:4].usm_type == usm_type
+    if usm_type is None:
+        # assert against default USM type
+        assert getattr(dp, func)(usm_type=usm_type)[0:4].usm_type == "device"
+    else:
+        assert getattr(dp, func)(usm_type=usm_type)[0:4].usm_type == usm_type
 
 
 @pytest.mark.parametrize("usm_type", list_of_usm_types, ids=list_of_usm_types)
diff --git a/tests/third_party/cupy/creation_tests/test_from_data.py b/tests/third_party/cupy/creation_tests/test_from_data.py
--- a/tests/third_party/cupy/creation_tests/test_from_data.py
+++ b/tests/third_party/cupy/creation_tests/test_from_data.py
@@ -117,7 +117,7 @@ def test_array_from_nested_list_of_numpy(
     @testing.for_orders("CFAK", name="src_order")
     @testing.for_orders("CFAK", name="dst_order")
     @testing.for_all_dtypes_combination(names=("dtype1", "dtype2"))
-    @testing.numpy_cupy_array_equal()
+    @testing.numpy_cupy_array_equal(type_check=has_support_aspect64())
     def test_array_from_list_of_cupy(
         self, xp, dtype1, dtype2, src_order, dst_order
     ):
@@ -127,15 +127,6 @@ def test_array_from_list_of_cupy(
             testing.shaped_arange((3, 4), xp, dtype1, src_order),
             testing.shaped_arange((3, 4), xp, dtype2, src_order),
         ]
-
-        # need to align with the use case when device doesn't has aspect fp64
-        if xp is numpy and not has_support_aspect64():
-            dt = numpy.promote_types(dtype1, dtype2)
-            if dt == numpy.float64:
-                return numpy.array(a, order=dst_order, dtype=numpy.float32)
-            elif dt == numpy.complex128:
-                return numpy.array(a, order=dst_order, dtype=numpy.complex64)
-
         return xp.array(a, order=dst_order)
 
     @testing.for_orders("CFAK", name="src_order")
@@ -501,9 +492,6 @@ def test_asarray_from_big_endian(self, xp, dtype):
         # happens to work before the change in #5828
         return b + b
 
-    @pytest.mark.skip(
-        "TODO: remove once dpctl gh-1376 is merged to gold branch"
-    )
     @testing.for_CF_orders()
     @testing.for_all_dtypes()
     @testing.numpy_cupy_array_equal()
@@ -551,7 +539,6 @@ def test_fromfile(self, xp):
             fh.seek(0)
             return xp.fromfile(fh, dtype="u1")
 
-    @pytest.mark.usefixtures("allow_fall_back_on_numpy")
     @testing.numpy_cupy_array_equal()
     def test_fromfunction(self, xp):
         def function(i, j):
@@ -559,7 +546,6 @@ def function(i, j):
 
         return xp.fromfunction(function, shape=(3, 3), dtype=int)
 
-    @pytest.mark.usefixtures("allow_fall_back_on_numpy")
     @testing.numpy_cupy_array_equal(type_check=has_support_aspect64())
     def test_fromiter(self, xp):
         iterable = (x * x for x in range(5))
@@ -573,7 +559,6 @@ def test_fromstring(self, xp):
     def test_frombuffer(self, xp):
         return xp.frombuffer(b"\x01\x02", dtype=numpy.uint8)
 
-    @pytest.mark.usefixtures("allow_fall_back_on_numpy")
     @testing.numpy_cupy_array_equal()
     def test_loadtxt(self, xp):
         with tempfile.TemporaryFile() as fh:
@@ -610,7 +595,7 @@ def test_fromfile_big_endian(self, xp):
 @testing.parameterize(
     *testing.product(
         {
-            "ver": (max_cuda_array_interface_version,),
+            "ver": tuple(range(max_cuda_array_interface_version + 1)),
             "strides": (False, None, True),
         }
     )