1. 報錯如下:
發生異常: TypeError
rsub() received an invalid combination of arguments - got (Tensor, numpy.ndarray), but expected one of:
* (Tensor input, Tensor other, *, Number alpha)
* (Tensor input, Number other, Number alpha)
2. 解決如下
https://blog.csdn.net/m0_46527503/article/details/114549630
我的:在於numpy的array和pytorch的tensor,兩種類型不一致,不可以直接運算。