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/13 22:11:43 UTC
[GitHub] [incubator-mxnet] lvpasquier commented on issue #17275:
CosineEmbeddingLoss won't work after hybridize (ie. with symbol API)
lvpasquier commented on issue #17275: CosineEmbeddingLoss won't work after hybridize (ie. with symbol API)
URL: https://github.com/apache/incubator-mxnet/issues/17275#issuecomment-573896943
Hello, thanks for having a look.
Actually shape issue seems to occur even before that when `F.norm` is called.
```python
import mxnet as mx
from mxnet.gluon import HybridBlock
class Foo(HybridBlock):
def hybrid_forward(self, F, x, axis=-1):
return F.norm(x, axis=axis).reshape(-1, 1)
foo = Foo()
x = mx.random.randn(2, 2)
print(foo(x).shape) # (2, 1)
foo.hybridize()
print(foo(x).shape) # (2,)
```
----------------------------------------------------------------
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