Skip to content

Commit 39648aa

Browse files
authored
documentation (#172)
* doc * documentation
1 parent 8592cd6 commit 39648aa

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

_doc/patches.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ and triggered by ``with torch_export_patches(patch_transformers=True)``.
104104
This function does one class,
105105
:func:`onnx_diagnostic.torch_export_patches.onnx_export_serialization.register_cache_serialization`
106106
does 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`
108108
or :func:`onnx_diagnostic.torch_export_patches.onnx_export_serialization.unregister_cache_serialization`.
109109
Here 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

_doc/status/patches_coverage.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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

1922
Patched Classes
2023
===============

onnx_diagnostic/torch_export_patches/onnx_export_serialization.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)