def forward(self, title, content):
        title = self.encoder_tit(title)
        print(title.size())
#         print(title)
        title_rehape = torch.index_select(title, 2, torch.LongTensor([0,2,1]))

<ipython-input-260-15e690fe555f> in forward(self, title, content)
     53         print(title.size())
     54         print(title)
---> 55         title_rehape = torch.index_select(title, 2, torch.LongTensor([0,2,1]))
     56         title_out_1 = self.title_conv_1(title_rehape)
     57         title_out_2 = self.title_conv_2(title_rehape)

/home/quoniammm/anaconda3/envs/py3Tfgpu/lib/python3.6/site-packages/torch/autograd/variable.py in index_select(self, dim, index)
    679 
    680     def index_select(self, dim, index):
--> 681         return IndexSelect.apply(self, dim, index)
    682 
    683     def gather(self, dim, index):

RuntimeError: save_for_backward can only save input or output tensors, but argument 0 doesn't satisfy this condition

Why I can’t use torch.index_select in forward function?I’m very confused.