File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
onnx_diagnostic/torch_export_patches Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ and triggered by ``with torch_export_patches(patch_transformers=True)``.
104104This function does one class,
105105:func: `onnx_diagnostic.torch_export_patches.onnx_export_serialization.register_cache_serialization `
106106does all known classes.
107- It can be undone with :func: `onnx_diagnostic.torch_export_patches.onnx_export_serialization.unregister `
107+ It can be undone with :func: `onnx_diagnostic.torch_export_patches.onnx_export_serialization.unregister_class_serialization `
108108or :func: `onnx_diagnostic.torch_export_patches.onnx_export_serialization.unregister_cache_serialization `.
109109Here is the list of supported caches:
110110
@@ -113,7 +113,10 @@ Here is the list of supported caches:
113113
114114 import onnx_diagnostic.torch_export_patches.onnx_export_serialization as p
115115
116- print("\n ".join(sorted(t.__name__ for t in p.serialization_functions())))
116+ print(
117+ "\n ".join(sorted(t.__name__ for t in p.serialization_functions(
118+ patch_transformers=True, patch_diffusers=True)))
119+ )
117120
118121.. _l-control-flow-rewriting :
119122
Original file line number Diff line number Diff line change @@ -14,7 +14,10 @@ The following code shows the list of serialized classes in transformers.
1414
1515 import onnx_diagnostic.torch_export_patches.onnx_export_serialization as p
1616
17- print('\n '.join(sorted(t.__name__ for t in p.serialization_functions())))
17+ print(
18+ '\n '.join(sorted(t.__name__ for t in p.serialization_functions(
19+ patch_transformers=True, patch_diffusers=True
20+ ))))
1821
1922Patched Classes
2023===============
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ def register_class_serialization(
2828) -> bool :
2929 """
3030 Registers a class.
31- It can be undone with :func:`unregister`.
31+ It can be undone with
32+ :func:`onnx_diagnostic.torch_export_patches.onnx_export_serialization.unregister_class_serialization`.
3233
3334 :param cls: class to register
3435 :param f_flatten: see ``torch.utils._pytree.register_pytree_node``
@@ -77,7 +78,8 @@ def register_cache_serialization(
7778 patch_transformers : bool = False , patch_diffusers : bool = True , verbose : int = 0
7879) -> Dict [str , bool ]:
7980 """
80- Registers many classes with :func:`register_class_serialization`.
81+ Registers many classes with
82+ :func:`onnx_diagnostic.torch_export_patches.onnx_export_serialization.register_class_serialization`.
8183 Returns information needed to undo the registration.
8284
8385 :param patch_transformers: add serialization function for
You can’t perform that action at this time.
0 commit comments