
    
9j_!                        S SK Jr  S SKrS SKJr  S SKJr  SSS.S jjrSSSS.S	 jjrSSSS.S
 jjr	SS jr
SS jrS rS rS rS rS rS rS rg)    )annotationsN)_core)fusionFblockingc          	     4    [         R                  " XX#XEU5      $ )a  Creates an array on the current device.

This function currently does not support the ``subok`` option.

Args:
    obj: :class:`cupy.ndarray` object or any other object that can be
        passed to :func:`numpy.array`.
    dtype: Data type specifier.
    copy (bool, optional): If ``True`` (default), ``obj`` is always copied.
        If ``False``, prohibits copy and raises `ValueError` on failure.
        If ``None``, ``obj`` is copied only when necessary.
    order ({'C', 'F', 'A', 'K'}): Row-major (C-style) or column-major
        (Fortran-style) order.
        When ``order`` is ``'A'``, it uses ``'F'`` if ``a`` is column-major
        and uses ``'C'`` otherwise.
        And when ``order`` is ``'K'``, it keeps strides as closely as
        possible.
        If ``obj`` is :class:`numpy.ndarray`, the function returns ``'C'``
        or ``'F'`` order array.
    subok (bool): If ``True``, then sub-classes will be passed-through,
        otherwise the returned array will be forced to be a base-class
        array (default).
    ndmin (int): Minimum number of dimensions. Ones are inserted to the
        head of the shape if needed.
    blocking (bool): Default is ``False``, meaning if a H2D copy is needed
        it would run asynchronously on the current stream, and users are
        responsible for ensuring the stream order. For example, writing to
        the source ``obj`` without proper ordering while copying would
        result in a race condition. If set to ``True``, the copy is
        synchronous (with respect to the host).

Returns:
    cupy.ndarray: An array on the current device.

.. note::
   This method currently does not support ``subok`` argument.

.. note::
   If ``obj`` is an `numpy.ndarray` instance that contains big-endian data,
   this function automatically swaps its byte order to little-endian,
   which is the NVIDIA and AMD GPU architecture's native use.

.. seealso:: :func:`numpy.array`

r   array)objdtypecopyordersubokndminr   s          R/home/wildlama/miniconda3/lib/python3.13/site-packages/cupy/_creation/from_data.pyr
   r
   	   s    ^ ;;s4hGG    )r   r   c               .    [         R                  " XX2US9$ )a  Converts an object to array.

This is equivalent to ``array(a, dtype, copy=False, order=order)``.

Args:
    a: The source object.
    dtype: Data type specifier. It is inferred from the input by default.
    order ({'C', 'F', 'A', 'K'}):
        Whether to use row-major (C-style) or column-major (Fortran-style)
        memory representation. Defaults to ``'K'``. ``order`` is ignored
        for objects that are not :class:`cupy.ndarray`, but have the
        ``__cuda_array_interface__`` attribute.
    copy (bool, optional): If ``True``, ``obj`` is always copied.
        If ``False``, prohibits copy and raises `ValueError` on failure.
        If ``None`` (default), ``obj`` is copied only when necessary.
    blocking (bool): Default is ``False``, meaning if a H2D copy is needed
        it would run asynchronously on the current stream, and users are
        responsible for ensuring the stream order. For example, writing to
        the source ``a`` without proper ordering while copying would
        result in a race condition. If set to ``True``, the copy is
        synchronous (with respect to the host).

Returns:
    cupy.ndarray: An array on the current device. If ``a`` is already on
    the device, no copy is performed.

.. note::
   If ``a`` is an `numpy.ndarray` instance that contains big-endian data,
   this function automatically swaps its byte order to little-endian,
   which is the NVIDIA and AMD GPU architecture's native use.

.. seealso:: :func:`numpy.asarray`

r   r	   ar   r   r   r   s        r   asarrayr   ;   s    F ;;qx@@r   c               .    [         R                  " XX2US9$ )aZ  Converts an object to array.

This is currently equivalent to :func:`cupy.asarray`, since there is no
subclass of :class:`cupy.ndarray` in CuPy. Note that the original
:func:`numpy.asanyarray` returns the input array as is if it is an instance
of a subtype of :class:`numpy.ndarray`.

.. seealso:: :func:`cupy.asarray`, :func:`numpy.asanyarray`

r   r	   r   s        r   
asanyarrayr   a   s     ;;qx@@r   c                .    [         R                  " X5      $ )a	  Returns a C-contiguous array.

Args:
    a (cupy.ndarray): Source array.
    dtype: Data type specifier.

Returns:
    cupy.ndarray: If no copy is required, it returns ``a``. Otherwise, it
    returns a copy of ``a``.

.. seealso:: :func:`numpy.ascontiguousarray`

)r   ascontiguousarray)r   r   s     r   r   r   o   s     ""1,,r   c                    [         R                  " 5       (       a6  US:w  a  [        S5      e[         R                  " [        R
                  U 5      $ U R                  US9$ )a  Creates a copy of a given array on the current device.

This function allocates the new array on the current device. If the given
array is allocated on the different device, then this function tries to
copy the contents over the devices.

Args:
    a (cupy.ndarray): The source array.
    order ({'C', 'F', 'A', 'K'}): Row-major (C-style) or column-major
        (Fortran-style) order.
        When ``order`` is ``'A'``, it uses ``'F'`` if ``a`` is column-major
        and uses ``'C'`` otherwise.
        And when ``order`` is ``'K'``, it keeps strides as closely as
        possible.

Returns:
    cupy.ndarray: The copy of ``a`` on the current device.

.. seealso:: :func:`numpy.copy`, :meth:`cupy.ndarray.copy`

Kz1cupy.copy does not support `order` in fusion yet.)r   )r   
_is_fusingNotImplementedError_call_ufuncr   elementwise_copyr   )r   r   s     r   r   r      sX    , C<%CE E!!%"8"8!<<
 666r   c                 @    [        [        R                  " U 0 UD65      $ )zInterpret a buffer as a 1-dimensional array.

.. note::
    Uses NumPy's ``frombuffer`` and coerces the result to a CuPy array.

.. seealso:: :func:`numpy.frombuffer`

)r   numpy
frombufferargskwargss     r   r#   r#      s     5##T4V455r   c                 @    [        [        R                  " U 0 UD65      $ )aY  Reads an array from a file.

.. note::
    Uses NumPy's ``fromfile`` and coerces the result to a CuPy array.

.. note::
   If you let NumPy's ``fromfile`` read the file in big-endian, CuPy
   automatically swaps its byte order to little-endian, which is the NVIDIA
   and AMD GPU architecture's native use.

.. seealso:: :func:`numpy.fromfile`

)r   r"   fromfiler$   s     r   r(   r(      s     5>>426233r   c                 @    [        [        R                  " U 0 UD65      $ )zConstruct an array by executing a function over each coordinate.

.. note::
    Uses NumPy's ``fromfunction`` and coerces the result to a CuPy array.

.. seealso:: :func:`numpy.fromfunction`
)r   r"   fromfunctionr$   s     r   r*   r*      s     5%%t6v677r   c                 @    [        [        R                  " U 0 UD65      $ )zCreate a new 1-dimensional array from an iterable object.

.. note::
    Uses NumPy's ``fromiter`` and coerces the result to a CuPy array.

.. seealso:: :func:`numpy.fromiter`
)r   r"   fromiterr$   s     r   r,   r,      s     5>>426233r   c                 @    [        [        R                  " U 0 UD65      $ )zA new 1-D array initialized from text data in a string.

.. note::
    Uses NumPy's ``fromstring`` and coerces the result to a CuPy array.

.. seealso:: :func:`numpy.fromstring`
)r   r"   
fromstringr$   s     r   r.   r.           5##T4V455r   c                 @    [        [        R                  " U 0 UD65      $ )zLoad data from a text file.

.. note::
    Uses NumPy's ``loadtxt`` and coerces the result to a CuPy array.

.. seealso:: :func:`numpy.loadtxt`
)r   r"   loadtxtr$   s     r   r1   r1      s     5==$1&122r   c                 @    [        [        R                  " U 0 UD65      $ )zLoad data from text file, with missing values handled as specified.

.. note::
    Uses NumPy's ``genfromtxt`` and coerces the result to a CuPy array.

.. seealso:: :func:`numpy.genfromtxt`
)r   r"   
genfromtxtr$   s     r   r3   r3      r/   r   )NTr   Fr   )NN)N)r   )
__future__r   r"   cupyr   
cupy._corer   r
   r   r   r   r   r#   r(   r*   r,   r.   r1   r3    r   r   <module>r8      sp    "   /H/Hd#Ate #ALA$ A-&D	64"84636r   