Commit 9487527
authored
[python][backends] Setup sys.modules with any loaded backend (triton-lang#6468)
From [importlib's
docs](https://docs.python.org/3.13/library/importlib.html#importing-a-source-file-directly)
you're supposed to setup `sys.modules` with the imported module after
you import it, and the name should be the fully qualified import path.
Besides following the docs, this enables any external user to
access/reference a backend module (otherwise there's no easy way--
meaning without traversing the `gc`-- to access those modules).1 parent 191ece3 commit 9487527
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | | - | |
44 | | - | |
| 45 | + | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
0 commit comments