【踩坑】RuntimeError: Input and parameter tensors are not the same dtype, found input tensor with Double

浅浅的花香味﹌ 2023-01-16 02:55 265阅读 0赞

报错

  1. RuntimeError: Input and parameter tensors are not the same dtype, found input tensor with Double and parameter tensor with Float

github issue

在GRU网络,需要传入Float的tensor,但是我传入的dtype是torch.float32
因此需要先转成float

  1. output=output.float()

发表评论

表情:
评论列表 (有 0 条评论,265人围观)

还没有评论,来说两句吧...

相关阅读