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 2019/11/24 08:46:42 UTC
[GitHub] [incubator-mxnet] sxjscience commented on issue #16279: [Bug]
Inconsistency between HybridBlock and Block
sxjscience commented on issue #16279: [Bug] Inconsistency between HybridBlock and Block
URL: https://github.com/apache/incubator-mxnet/issues/16279#issuecomment-557869057
This will be solved once https://github.com/apache/incubator-mxnet/pull/16621 is merged. We have the following example:
```python
import mxnet as mx
from mxnet.gluon import HybridBlock
mx.npx.set_np()
class Foo2(HybridBlock):
def hybrid_forward(self, F, a):
return a[0]
b1 = Foo2(prefix='hybridized')
b1.hybridize()
b2 = Foo2(prefix='no_hybrid')
out1 = b1(mx.np.ones((10,)))
out2 = b2(mx.np.ones((10,)))
print(out1)
print(out2)
```
Out:
```
1.0
1.0
```
----------------------------------------------------------------
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