pytorch多变量时间序列预测报错,求解决办法!

```python
RuntimeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_8196/3702095365.py in
1 # Make prediction and plot
2 y_train = scaler.inverse_transform(y_train)
----> 3 y_predict = dbn.predict(x_test, batch_size)
4 y_real = scaler.inverse_transform(y_test)
5 y_predict = scaler.inverse_transform(y_predict.reshape(-1,1))

~\DBF\DBN.py in predict(self, x, batch_size, shuffle)
221 with torch.no_grad():
222 for batch in dataloader:
--> 223 y = self.forward(batch[0])
224 y_predict = torch.cat((y_predict, y.cpu()), 0)
225

~\DBF\DBN.py in forward(self, input_data)
58 hid_output = v.clone()
59 for i in range(len(self.rbm_layers)):
---> 60 hid_output, _ = self.rbm_layers[i].to_hidden(hid_output)
61 output = self.bpnn(hid_output)
62 return output

~\DBF\RBM.py in to_hidden(self, vis_prob)
75 hid_prob = torch.add(hid_prob, self.h_bias)
76 hid_prob = self.activation(hid_prob)
---> 77 hid_sample = torch.bernoulli(hid_prob)
78 return hid_prob, hid_sample
79

RuntimeError: Expected p_in >= 0 && p_in <= 1 to be true, but got false. (Could this error message be improved? If so, please report an enhancement request to PyTorch.)

```问题遇到的现象和发生背景

问题相关代码,请勿粘贴截图
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果