Same line number? Different error? With the code you have here I can’t fully debug it. But if that’s the case then my guess is that you need to get rid of the .numpy(). Most pytorch functionality requires either a Variable or a Tensor.
Can you explain what you mean by that question a bit more?