Thanks for reply
Actually forward function in module is something like:

for i in range(n):
            x1 = Variable(z.view(1,-1),requires_grad=True)
           fc_input = torch.cat((z,state),1)
            fc_out = self.fc1(fc_input)
            y1 = nn.Module.sigmoid(x)
            y_list.append(y1.data[0][0])
           prob = nn.Module.Softmax(y_list)
           choices = prob.Multinomial()
return choices

I want normalize a series of sigmoid output using softmax, and take that normalized activation to somehow calculate a reward. Then take that reward to update fc linear layer by reinforce algorithm.
I’ve tried:
choices = Variable(choices.data, requires_grad=True)
I didn’t get that RuntimeError anymore, but the parameters in module remained unchanged.
Now that .data strips gradients, how can I apply softmax to a list consisted of sigmoid output (which contains Variables)?
Thanks