File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 35
35
sys .path .insert (0 , os .path .abspath ('..' ))
36
36
# Include local extension.
37
37
sys .path .append (os .path .abspath ('./_ext' ))
38
+ # Set environment variable to indicate that we are building the docs.
39
+ os .environ ['FLAX_DOC_BUILD' ] = 'true'
38
40
39
41
# patch sphinx
40
42
# -- Project information -----------------------------------------------------
Original file line number Diff line number Diff line change 16
16
17
17
import dataclasses
18
18
import inspect
19
+ import os
19
20
import threading
20
21
import typing as tp
21
22
from abc import ABCMeta
38
39
39
40
G = tp .TypeVar ('G' , bound = 'Object' )
40
41
42
+ BUILDING_DOCS = 'FLAX_DOC_BUILD' in os .environ
41
43
42
44
def _collect_stats (
43
45
node : tp .Any , node_stats : dict [int , dict [type [Variable ], SizeBytes ]]
@@ -157,7 +159,9 @@ def __init_subclass__(cls) -> None:
157
159
init = cls ._graph_node_init , # type: ignore
158
160
)
159
161
160
- cls .__signature__ = inspect .signature (cls .__init__ )
162
+ if BUILDING_DOCS :
163
+ # set correct signature for sphinx
164
+ cls .__signature__ = inspect .signature (cls .__init__ )
161
165
162
166
if not tp .TYPE_CHECKING :
163
167
You can’t perform that action at this time.
0 commit comments