-
Notifications
You must be signed in to change notification settings - Fork 25
add cli api python3 -m graph_net.torch.subrange_graph #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Thanks for your contribution! |
graph_net/torch/subrange_graph.py
Outdated
external_inputs = set() | ||
for node in selected_nodes: | ||
if hasattr(node, "args") and hasattr(node, "kwargs"): | ||
for arg in itertools.chain(node.args, node.kwargs.values()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嵌套太深
graph_net/torch/subrange_graph.py
Outdated
missing_deps = [] | ||
if hasattr(node, "args"): | ||
for arg in node.args: | ||
if isinstance(arg, fx.Node) and arg not in node_map: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嵌套太深
graph_net/torch/subrange_graph.py
Outdated
import argparse | ||
|
||
|
||
def subrange_graph_extract(original_gm: fx.GraphModule, start_idx: int, end_idx: int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这函数太长了,没法一分钟内理解
PR Category
Feature Enhancement
Description
Demo:


GraphModule:
extract [2,5] subrange: