onnx_diagnostic.torch_export_patches.patches.patch_transformers¶
- class onnx_diagnostic.torch_export_patches.patches.patch_transformers.patched_AttentionMaskConverter[source]¶
Patches
transformers.modeling_attn_mask_utils.AttentionMaskConverter._make_causal_mask.
- class onnx_diagnostic.torch_export_patches.patches.patch_transformers.patched_DynamicCache(num_hidden_layers: int | None = None)[source]¶
Removes the dependency on
torch.nn.Modulefromtransformers.cache_utils.DynamicCache.- batch_split(full_batch_size: int, split_size: int, num_hidden_layers: int | None = None) List[DynamicCache][source]¶
- classmethod from_batch_splits(splits: List[DynamicCache], num_hidden_layers: int | None = None) DynamicCache[source]¶