interesaaat edited a comment on issue #6300:
URL: https://github.com/apache/incubator-tvm/issues/6300#issuecomment-676753180
Ok I found the solution, but I think I am hitting some bug. So in the
`__init__` of the module I have:
```
self.nodes_offset = torch.nn.Parameter(torch.LongTensor(nodes_offset),
requires_grad=False)
```
and I the middle of the `forward` method I am doing:
```
indexes = indexes + self.nodes_offset
```
(this is what it throwing the 2 casts and related exception).
Interestingly, if I do:
```
def forward(self, x):
self.nodes_offset.long()
```
(meaning forcing a cast at the beginning of the `forward` method) it works.
If instead I add the cast in `__init__` I still get the same error. Is this
something related with tracing?
----------------------------------------------------------------
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]