Hi all,
I created my model as follows. self.outv is a learnable parameter.
class model(nn.Module):
    def __init__(self):
        super(model,self).__init__()
        self.lstm1=nn.LSTM(300,1024,num_layers=1)
        self.batch_size=1
        self.tanh=nn.Tanh()
        self.softmax=nn.Softmax()
        self.fc1=nn.Linear(1024,512)
        self.drop=nn.Dropout(0.5)
        self.outv=nn.Parameter(torch.randn(512))
        if torch.cuda.is_available:
            self.lstm1=self.lstm1.cuda(gpu_device)
            self.fc1=self.fc1.cuda(gpu_device)
            self.outv=self.outv.cuda(gpu_device)
    def forward(self,features):
        emb1=self.get_embedding(features)
        out1=self.fc1(emb1)
        out1=self.drop(out1)
        out2=torch.dot(self.outv,out1)
        return out2
    def get_embedding(self,featues):
        hidden = (autograd.Variable(torch.randn(1, 1, 1024)).cuda(gpu_device),
          autograd.Variable(torch.randn((1, 1, 1024))).cuda(gpu_device)) #initialization of hidden state: creates two variables each contain a 1x1x3 tensor
        #passing data
        for w_embed in features:
            self.lstm1.flatten_parameters()
            out,hidden=self.lstm1(Variable(torch.from_numpy(np.array(w_embed)),volatile=True).view(1,1,300).cuda(gpu_device),hidden)
        return out
 
m=model()
m=m.cuda(gpu_device)
print(m.parameters)
#print output
<bound method Module.parameters of model(
  (lstm1): LSTM(300, 1024)
  (tanh): Tanh()
  (softmax): Softmax()
  (fc1): Linear(in_features=1024, out_features=512, bias=True)
  (drop): Dropout(p=0.5)
)>

I have few doubts.

Why self.outv is  not listed in m.parameters. Is there any problem in my code?
How can I move the model to multiple gpus?

Thanks