onnx_diagnostic.torch_export_patches.serialization.transformers_impl

onnx_diagnostic.torch_export_patches.serialization.transformers_impl.flatten_dynamic_cache(dynamic_cache: DynamicCache) Tuple[List[Any], Any][source][source]

Serializes a transformers.cache_utils.DynamicCache with python objects.

onnx_diagnostic.torch_export_patches.serialization.transformers_impl.flatten_encoder_decoder_cache(ec_cache: EncoderDecoderCache) Tuple[List[Any], Any][source][source]

Serializes a transformers.cache_utils.EncoderDecoderCache with python objects.

onnx_diagnostic.torch_export_patches.serialization.transformers_impl.flatten_mamba_cache(mamba_cache: MambaCache) Tuple[List[Any], Any][source][source]

Serializes a transformers.cache_utils.MambaCache with python objects.

onnx_diagnostic.torch_export_patches.serialization.transformers_impl.flatten_sliding_window_cache(cache: SlidingWindowCache) Tuple[List[Any], Any][source][source]

Serializes a transformers.cache_utils.SlidingWindowCache with python objects.

onnx_diagnostic.torch_export_patches.serialization.transformers_impl.flatten_static_cache(cache: StaticCache) Tuple[List[Any], Any][source][source]

Serializes a transformers.cache_utils.StaticCache with python objects.

onnx_diagnostic.torch_export_patches.serialization.transformers_impl.flatten_with_keys_dynamic_cache(dynamic_cache: DynamicCache) Tuple[List[Tuple[KeyEntry, Any]], Any][source][source]

Serializes a transformers.cache_utils.DynamicCache with python objects.

onnx_diagnostic.torch_export_patches.serialization.transformers_impl.flatten_with_keys_encoder_decoder_cache(ec_cache: EncoderDecoderCache) Tuple[List[Tuple[KeyEntry, Any]], Any][source][source]

Serializes a transformers.cache_utils.EncoderDecoderCache with python objects.

onnx_diagnostic.torch_export_patches.serialization.transformers_impl.flatten_with_keys_mamba_cache(cache: MambaCache) Tuple[List[Tuple[KeyEntry, Any]], Any][source][source]

Serializes a transformers.cache_utils.MambaCache with python objects.

onnx_diagnostic.torch_export_patches.serialization.transformers_impl.flatten_with_keys_sliding_window_cache(cache: SlidingWindowCache) Tuple[List[Tuple[KeyEntry, Any]], Any][source][source]

Serializes a transformers.cache_utils.SlidingWindowCache with python objects.

onnx_diagnostic.torch_export_patches.serialization.transformers_impl.flatten_with_keys_static_cache(cache: StaticCache) Tuple[List[Tuple[KeyEntry, Any]], Any][source][source]

Serializes a transformers.cache_utils.StaticCache with python objects.

onnx_diagnostic.torch_export_patches.serialization.transformers_impl.unflatten_dynamic_cache(values: List[Any], context: Any, output_type=None) DynamicCache[source][source]

Restores a transformers.cache_utils.DynamicCache from python objects.

onnx_diagnostic.torch_export_patches.serialization.transformers_impl.unflatten_encoder_decoder_cache(values: List[Any], context: Any, output_type=None) EncoderDecoderCache[source][source]

Restores a transformers.cache_utils.EncoderDecoderCache from python objects.

onnx_diagnostic.torch_export_patches.serialization.transformers_impl.unflatten_mamba_cache(values: List[Any], context: Any, output_type=None) MambaCache[source][source]

Restores a transformers.cache_utils.MambaCache from python objects.

onnx_diagnostic.torch_export_patches.serialization.transformers_impl.unflatten_sliding_window_cache(values: List[Any], context: Any, output_type=None) SlidingWindowCache[source][source]

Restores a transformers.cache_utils.SlidingWindowCache from python objects.

onnx_diagnostic.torch_export_patches.serialization.transformers_impl.unflatten_static_cache(values: List[Any], context: Any, output_type=None) StaticCache[source][source]

Restores a transformers.cache_utils.StaticCache from python objects.