You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/01/06 04:46:05 UTC

[GitHub] [incubator-mxnet] eric-haibin-lin opened a new issue #17220: Cannot access child blocks' parameter in parent block's hybrid_forward

eric-haibin-lin opened a new issue #17220: Cannot access child blocks' parameter in parent block's hybrid_forward
URL: https://github.com/apache/incubator-mxnet/issues/17220
 
 
   I have a very simple model:
   ```
   class MyBlock(HybridBlock):
       def __init__(self):
           self.dense1 = nn.Dense(10)
           self.dense2 = nn.Dense(10)
   
       def hybrid_forward(self, F, x):
           # I want to concat the weights of `self.dense1` and `self.dense2`.
           # how do I do that? 
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on issue #17220: Cannot access child blocks' parameter in parent block's hybrid_forward

Posted by GitBox <gi...@apache.org>.
leezu commented on issue #17220: Cannot access child blocks' parameter in parent block's hybrid_forward
URL: https://github.com/apache/incubator-mxnet/issues/17220#issuecomment-571630808
 
 
   What's the use-case to input symbol into `forward`? It wouldn't work in most cases because `forward` doesn't have `F`. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu commented on issue #17220: Cannot access child blocks' parameter in parent block's hybrid_forward

Posted by GitBox <gi...@apache.org>.
leezu commented on issue #17220: Cannot access child blocks' parameter in parent block's hybrid_forward
URL: https://github.com/apache/incubator-mxnet/issues/17220#issuecomment-571088223
 
 
   I suggest we deprecate `hybrid_forward`, in which parameters are passed as function arguments.
   Instead users should access parameters via the `self.weight.data(ctx)` syntax used in `Block`.
   
   Then you may access child-block parameters as `self.childblock.weight.data(ctx)`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] eric-haibin-lin commented on issue #17220: Cannot access child blocks' parameter in parent block's hybrid_forward

Posted by GitBox <gi...@apache.org>.
eric-haibin-lin commented on issue #17220: Cannot access child blocks' parameter in parent block's hybrid_forward
URL: https://github.com/apache/incubator-mxnet/issues/17220#issuecomment-571769821
 
 
   nevermind, in gluon 2.0 the symbol and ndarray will be unified. As long as it still support hybridization, it's fine 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] eric-haibin-lin commented on issue #17220: Cannot access child blocks' parameter in parent block's hybrid_forward

Posted by GitBox <gi...@apache.org>.
eric-haibin-lin commented on issue #17220: Cannot access child blocks' parameter in parent block's hybrid_forward
URL: https://github.com/apache/incubator-mxnet/issues/17220#issuecomment-571371930
 
 
   Shall we also consider the case where input is a symbol so the `ctx` is not visible to `forward`?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-mxnet] leezu closed issue #17220: Cannot access child blocks' parameter in parent block's hybrid_forward

Posted by GitBox <gi...@apache.org>.
leezu closed issue #17220:
URL: https://github.com/apache/incubator-mxnet/issues/17220


   


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@mxnet.apache.org
For additional commands, e-mail: issues-help@mxnet.apache.org