srush / Tensor-Puzzles

Solve puzzles. Improve your pytorch.
MIT License
3.19k stars 269 forks source link

Problem 18 throwing unexplainable error #8

Closed ignasa007 closed 2 years ago

ignasa007 commented 2 years ago

I was working on problem 18 and it is throwing an assertion error when checking the equality between the target and the function output. However, the two tensors seem to be equal. Am I missing something?

Screenshot 2022-07-14 at 4 11 59 AM
srush commented 2 years ago

This is our fault. All the other problems are integers so torch.equal works. However for this one it is a float so it should be ".almost_equal". But your answer looks right.

srush commented 2 years ago

Should now be fixed on reload.