experimental_experiment.torch_interpreter.onnx_export_serialization

experimental_experiment.torch_interpreter.onnx_export_serialization.flatten_dynamic_cache(dynamic_cache: transformers.cache_utils.DynamicCache) Tuple[List[Any], torch.utils._pytree.Context][source]

Serializes a transformers.cache_utils.DynamicCache with python objects.

experimental_experiment.torch_interpreter.onnx_export_serialization.flatten_mamba_cache(mamba_cache: transformers.cache_utils.MambaCache) Tuple[List[Any], torch.utils._pytree.Context][source]

Serializes a transformers.cache_utils.MambaCache with python objects.

experimental_experiment.torch_interpreter.onnx_export_serialization.flatten_with_keys_dynamic_cache(d: Dict[Any, Any]) Tuple[List[Tuple[torch.utils._pytree.KeyEntry, Any]], torch.utils._pytree.Context][source]

Serializes a transformers.cache_utils.DynamicCache with python objects.

experimental_experiment.torch_interpreter.onnx_export_serialization.flatten_with_keys_mamba_cache(d: Dict[Any, Any]) Tuple[List[Tuple[torch.utils._pytree.KeyEntry, Any]], torch.utils._pytree.Context][source]

Serializes a transformers.cache_utils.MambaCache with python objects.

experimental_experiment.torch_interpreter.onnx_export_serialization.unflatten_dynamic_cache(values: List[Any], context: torch.utils._pytree.Context, output_type=None) transformers.cache_utils.DynamicCache[source]

Restores a transformers.cache_utils.DynamicCache from python objects.

experimental_experiment.torch_interpreter.onnx_export_serialization.unflatten_mamba_cache(values: List[Any], context: torch.utils._pytree.Context, output_type=None) transformers.cache_utils.MambaCache[source]

Restores a transformers.cache_utils.MambaCache from python objects.

experimental_experiment.torch_interpreter.onnx_export_serialization.unflatten_pached_dynamic_cache(values: List[Any], context: torch.utils._pytree.Context, output_type=None) transformers.cache_utils.DynamicCache[source]

Restores a patched_DynamicCache from python objects.