问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
self.hidden = (torch.zeros(1, 1, self.hidden_size),torch.zeros(1, 1, self.hidden_size)).to(device)
运行结果及报错内容
self.hidden = (torch.zeros(1, 1, self.hidden_size),torch.zeros(1, 1, self.hidden_size)).to(device)
AttributeError: 'tuple' object has no attribute 'to'