Skip to content

Commit 9030f7a

Browse files
committed
Merge branch 'develop' of github.com:PaddlePaddle/GraphNet into develop
2 parents 5e309b0 + d7cf909 commit 9030f7a

20 files changed

+1879
-407
lines changed

docs/README_contribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import graph_net
4949
model = ...
5050

5151
# Extract your own model
52-
model = graph_net.torch.extract(name="model_name", dynamic="True")(model)
52+
model = graph_net.torch.extract(name="model_name", dynamic=True)(model)
5353
```
5454

5555
After running, the extracted graph will be saved to: `$GRAPH_NET_EXTRACT_WORKSPACE/model_name/`.

graph_net/__init__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1+
__all__ = ["torch", "paddle"]
12

3+
from importlib import import_module
4+
from typing import TYPE_CHECKING, Any, List
5+
6+
7+
def __getattr__(name: str) -> Any:
8+
if name in __all__:
9+
module = import_module(f"{__name__}.{name}")
10+
globals()[name] = module
11+
return module
12+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
13+
14+
15+
def __dir__() -> List[str]:
16+
return sorted(list(globals().keys()) + __all__)
17+
18+
19+
if TYPE_CHECKING:
20+
from . import torch as torch # type: ignore
21+
from . import paddle as paddle # type: ignore

0 commit comments

Comments
 (0)