samskalicky commented on a change in pull request #15969: [WIP] Partitioning 
Gluon HybridBlocks
URL: https://github.com/apache/incubator-mxnet/pull/15969#discussion_r372705506
 
 

 ##########
 File path: python/mxnet/gluon/block.py
 ##########
 @@ -954,6 +955,18 @@ def _build_cache(self, *args):
             unused = ', '.join(list(param_names - set(used_param_names)))
             warnings.warn("Parameter %s is not used by any computation. "
                           "Is this intended?"%unused, stacklevel=4)
+        if self._backend:
+            arg_array = []
+            ctx = None
 
 Review comment:
   I think we only need to assign `ctx` to `args[0].context` since in gluon 
there must be at least one input to the model and all inputs/params have to be 
on the same context. Then we dont need to do it in the loop. 

----------------------------------------------------------------
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