quimb.tensor.interface ====================== .. py:module:: quimb.tensor.interface .. autoapi-nested-parse:: Tools for interfacing the tensor and tensor network objects with other libraries. Attributes ---------- .. autoapisummary:: quimb.tensor.interface._JAX_REGISTERED_TN_CLASSES Classes ------- .. autoapisummary:: quimb.tensor.interface.Placeholder Functions --------- .. autoapisummary:: quimb.tensor.interface.pack quimb.tensor.interface.unpack quimb.tensor.interface.jax_pack quimb.tensor.interface.jax_unpack quimb.tensor.interface.jax_register_pytree quimb.tensor.interface.get_jax Module Contents --------------- .. py:class:: Placeholder(x) .. py:attribute:: __slots__ :value: ('shape',) .. py:attribute:: shape .. py:method:: __repr__() .. py:function:: pack(obj) Take a tensor or tensor network like object and return a skeleton needed to reconstruct it, and a pytree of raw parameters. :param obj: Something that has ``copy``, ``set_params``, and ``get_params`` methods. :type obj: Tensor, TensorNetwork, or similar :returns: * **params** (*pytree*) -- A pytree of raw parameter arrays. * **skeleton** (*Tensor, TensorNetwork, or similar*) -- A copy of ``obj`` with all references to the original data removed. .. py:function:: unpack(params, skeleton) Take a skeleton of a tensor or tensor network like object and a pytree of raw parameters and return a new reconstructed object with those parameters inserted. :param params: A pytree of raw parameter arrays, with the same structure as the output of ``skeleton.get_params()``. :type params: pytree :param skeleton: Something that has ``copy``, ``set_params``, and ``get_params`` methods. :type skeleton: Tensor, TensorNetwork, or similar :returns: **obj** -- A copy of ``skeleton`` with parameters inserted. :rtype: Tensor, TensorNetwork, or similar .. py:data:: _JAX_REGISTERED_TN_CLASSES .. py:function:: jax_pack(obj) .. py:function:: jax_unpack(aux, children) .. py:function:: jax_register_pytree() .. py:function:: get_jax()