liangfu commented on a change in pull request #4703: [VTA] Support network 
which have no unique operator as start/stop name for graph pack.
URL: https://github.com/apache/incubator-tvm/pull/4703#discussion_r367772171
 
 

 ##########
 File path: vta/python/vta/top/graphpack.py
 ##########
 @@ -246,32 +246,38 @@ def visit_call(self, call):
 
 class BT(Exception):
     pass
-def get_subgraph(expr, start_name, stop_name):
+def get_subgraph(expr, start_name, stop_name, start_name_idx=-1, 
stop_name_idx=-1):
 
 Review comment:
   I think there might be a misunderstanding.
   
   Let's take a specific example. For a network with layers defined as
   ```
   %0 = nn.conv2d
   %1 = nn.batch_norm
   %2 = nn.relu
   %3 = nn.max_pool2d
   %4 = nn.conv2d
   %5 = nn.batch_norm
   %6 = nn.relu
   %7 = nn.max_pool2d
   %8 = nn.conv2d
   %9 = nn.global_avg_pool2d
   %10 = nn.dense
   %11 = nn.softmax
   ```
   , we use your default configuration which means start_name="nn.max_pool2d", 
stop_name="nn.global_avg_pool2d", start_name_idx=-1, stop_name_idx=-1. What you 
would get would be the subgraph between %7 and %9. So, I'm suggesting setting 
`start_name_idx`=0, so that we could have the subgraph extracted between %3 and 
%9, which  I think would be more reasonable.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to