I’m implementing a custom module, which based on the input generates some index, and then index the input, and do operations (Conv etc.) on the indexed parts. Should I make the indices Variable or Tensor?
Currently, I implemented in Tensor, it works fine.
But say, I get the indices from nn.topk, which return indices as Variables, and then I need to return indices.data as my indices.
Which way is better?
Will the Tensor way cause some unknown bug?
If made the indices Variable, then it must have requires_grad = False, then what’s the sense of making it a Variable?