File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,20 @@ How it works
56
56
:alt: Autoloading implementation
57
57
:align: center
58
58
59
- This mechanism is implemented based on Python's `Entry point
59
+ This mechanism is implemented based on Python's `Entry points
60
60
<https://packaging.python.org/en/latest/specifications/entry-points/> `_
61
61
mechanism. We discover and load all of the specific entry points
62
62
in ``torch/__init__.py `` that are defined by out-of-tree extensions.
63
+ This feature is enabled by default and can be disabled using
64
+ ``export TORCH_DEVICE_BACKEND_AUTOLOAD=0 ``.
63
65
Its implementation is in `[RFC] Add support for device extension autoloading
64
- <https://github.com/pytorch/pytorch/pull/127074> `_
66
+ <https://github.com/pytorch/pytorch/pull/127074> `_.
67
+
68
+ .. note ::
69
+
70
+ If you get an error like this: "Failed to load the backend extension",
71
+ this error has nothing to do with PyTorch, you should ask the extension
72
+ maintainer for help.
65
73
66
74
How to apply this to out-of-tree extensions?
67
75
--------------------------------------------
@@ -91,6 +99,13 @@ package.
91
99
92
100
Now the ``torch_foo `` module can be imported when running import torch.
93
101
102
+ .. code-block :: python
103
+
104
+ >> > import torch
105
+ No need to import torch_foo anymore! You can run torch.foo.is_available() directly.
106
+ >> > torch.foo.is_available()
107
+ True
108
+
94
109
Conclusion
95
110
----------
96
111
You can’t perform that action at this time.
0 commit comments