# 遇到的错误
RuntimeError: Cannot insert a Tensor that requires grad as a constant. Consider making it a parameter or input, or detaching the gradient
# 解决办法
把模型构建过程中的list([])换成pytorch原生的nn.ModuleList()。
# 遇到的错误
RuntimeError: Cannot insert a Tensor that requires grad as a constant. Consider making it a parameter or input, or detaching the gradient
# 解决办法
把模型构建过程中的list([])换成pytorch原生的nn.ModuleList()。