sequince.array_api
==================

.. py:module:: sequince.array_api


Functions
---------

.. autoapisummary::

   sequince.array_api.enable_scipy_array_api
   sequince.array_api.namespace
   sequince.array_api.determine_backend_name
   sequince.array_api.resolve_dtype
   sequince.array_api.asarray
   sequince.array_api.copy
   sequince.array_api.to_numpy
   sequince.array_api.logsumexp


Module Contents
---------------

.. py:function:: enable_scipy_array_api()

   Enable SciPy Array API support; normally done during package import.


.. py:function:: namespace(*arrays)

   Return the array API namespace associated with the provided arrays.


.. py:function:: determine_backend_name(x = None, xp = None)

   Determine the backend name from an array or array API module.

   :param x: The array to infer the backend from. If None, xp must be provided.
   :type x: Array or None
   :param xp: The array API module to infer the backend from. If None, x must be provided.
   :type xp: Any or None

   :returns: The name of the backend. If the backend cannot be determined, returns "unknown".
   :rtype: str


.. py:function:: resolve_dtype(dtype, xp)

   Resolve a dtype-like value for an array API namespace.


.. py:function:: asarray(array, *, xp = None, dtype = None, like = None)

   Convert an array while preserving the requested namespace and device.


.. py:function:: copy(array, *, xp = None)

   Copy an array without changing its namespace or device.

   For JAX and PyTorch arrays, this will create a new array on the same device
   and preserves gradient tracking.


.. py:function:: to_numpy(array, *, dtype = None, copy = None)

   Detach an array, move it to CPU, and convert it to NumPy.


.. py:function:: logsumexp(array, *, axis = None, xp = None)

