@@ -102,7 +102,6 @@ class UniqueInverseResult(NamedTuple):
102102 "append" ,
103103 "array_split" ,
104104 "asarray_chkfinite" ,
105- "asfarray" ,
106105 "atleast_1d" ,
107106 "atleast_2d" ,
108107 "atleast_3d" ,
@@ -845,79 +844,6 @@ def asarray_chkfinite(
845844 return a
846845
847846
848- def asfarray (a , dtype = None , * , device = None , usm_type = None , sycl_queue = None ):
849- """
850- Return an array converted to a float type.
851-
852- For full documentation refer to :obj:`numpy.asfarray`.
853-
854- Parameters
855- ----------
856- a : array_like
857- Input data, in any form that can be converted to an array.
858- This includes an instance of :class:`dpnp.ndarray` or
859- :class:`dpctl.tensor.usm_ndarray`, an object representing
860- SYCL USM allocation and implementing `__sycl_usm_array_interface__`
861- protocol, an instance of :class:`numpy.ndarray`, an object supporting
862- Python buffer protocol, a Python scalar, or a (possibly nested)
863- sequence of Python scalars.
864- dtype : {None, str, dtype object}, optional
865- Float type code to coerce input array `a`. If `dtype` is ``None``,
866- :obj:`dpnp.bool` or one of the `int` dtypes, it is replaced with
867- the default floating type (:obj:`dpnp.float64` if a device supports it,
868- or :obj:`dpnp.float32` type otherwise).
869-
870- Default: ``None``.
871- device : {None, string, SyclDevice, SyclQueue, Device}, optional
872- An array API concept of device where the output array is created.
873- `device` can be ``None``, a oneAPI filter selector string, an instance
874- of :class:`dpctl.SyclDevice` corresponding to a non-partitioned SYCL
875- device, an instance of :class:`dpctl.SyclQueue`, or a
876- :class:`dpctl.tensor.Device` object returned by
877- :attr:`dpnp.ndarray.device`.
878-
879- Default: ``None``.
880- usm_type : {None, "device", "shared", "host"}, optional
881- The type of SYCL USM allocation for the output array.
882-
883- Default: ``None``.
884- sycl_queue : {None, SyclQueue}, optional
885- A SYCL queue to use for output array allocation and copying. The
886- `sycl_queue` can be passed as ``None`` (the default), which means
887- to get the SYCL queue from `device` keyword if present or to use
888- a default queue.
889-
890- Default: ``None``.
891-
892- Returns
893- -------
894- out : dpnp.ndarray
895- The input `a` as a float ndarray.
896-
897- Examples
898- --------
899- >>> import dpnp as np
900- >>> np.asfarray([2, 3])
901- array([2., 3.])
902- >>> np.asfarray([2, 3], dtype=dpnp.float32)
903- array([2., 3.], dtype=float32)
904- >>> np.asfarray([2, 3], dtype=dpnp.int32)
905- array([2., 3.])
906-
907- """
908-
909- _sycl_queue = dpnp .get_normalized_queue_device (
910- a , sycl_queue = sycl_queue , device = device
911- )
912-
913- if dtype is None or not dpnp .issubdtype (dtype , dpnp .inexact ):
914- dtype = dpnp .default_float_type (sycl_queue = _sycl_queue )
915-
916- return dpnp .asarray (
917- a , dtype = dtype , usm_type = usm_type , sycl_queue = _sycl_queue
918- )
919-
920-
921847def atleast_1d (* arys ):
922848 """
923849 Convert inputs to arrays with at least one dimension.
0 commit comments