I cannot reproduce the issue using:
class SiameseNetwork(nn.Module):
    def __init__(self):
        super(SiameseNetwork, self).__init__()
        self.device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
        self.dropout = 0.17
        self.n_units = 100
        self.n_label = 2
        self.w = nn.Linear(self.n_units,self.n_label).to(self.device)
        self.w_v = nn.Linear(2*self.n_units,self.n_units).to(self.device)
        self.lstm = nn.LSTM(input_size = self.n_units, hidden_size=self.n_units).to(self.device)
        self.blstm = nn.LSTM(input_size = self.n_units, hidden_size=self.n_units).to(self.device)
  
    def forward(self, object1, object2):
      output1 = self._traverse_obj(object1)
      output2 = self._traverse_obj(object2)
         
      return output1, output2


model = SiameseNetwork()
model.cuda()

Which PyTorch version are you using?