Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions graph_net/torch/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from . import utils

torch._dynamo.config.capture_scalar_outputs = True
torch._dynamo.config.capture_dynamic_output_shape_ops = True


def extract(name, dynamic=True, mut_graph_codes=None, placeholder_auto_rename=False):
Expand Down
2 changes: 2 additions & 0 deletions graph_net/torch/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def apply_templates(forward_code: str) -> str:
imports = "import torch"
if "device" in forward_code:
imports += "\n\nfrom torch import device"
if "inf" in forward_code:
imports += "\n\nfrom torch import inf"
return f"{imports}\n\nclass GraphModule(torch.nn.Module):\n{tab}{forward_code}"


Expand Down