Torch.equal(): Type Variable doesn't implement stateless method equal

Hi, I encountered this error when doing torch.equal(X, Y) between two variables. I can circumvent this by doing torch.equal(X.data, Y.data). My question is: when running on GPU, will this solution be slower than supporting stateless equal() natively? Thanks!

you are using the GPU with torch.equal(X.data, Y.data). There are some functions which are not differentiable, or have not yet been implemented in autograd, this is one of them.

1 Like