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/08/23 14:00:35 UTC
[GitHub] [incubator-mxnet] leezu commented on issue #14983: Bug with arange
inside a foreach
leezu commented on issue #14983: Bug with arange inside a foreach
URL: https://github.com/apache/incubator-mxnet/issues/14983#issuecomment-524326612
You can use the following workaround to make forward shape inference work for the use-case (thus working around the lack of reverse shape inference)
``` python
zeros = F.zeros_like(inputs)
arange = F.arange(start=0, repeat=1, step=1, infer_range=True, dtype='int32')
arange = F.elemwise_add(arange, zeros)
```
https://github.com/dmlc/gluon-nlp/blob/a9eb2fd38180b5affbd30ec78f33f6ef16ef9c20/src/gluonnlp/model/bert.py#L497-L499
----------------------------------------------------------------
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