Closed ahmadsharif1 closed 3 weeks ago
Thanks. Actually I just realized that in doing all the test refactors I missed a very important check -- we don't actually check that the frame is on the correct device.
@NicolasHug do you have any opinions on how it should be done.
I think we can even have a function like test_frame_against_reference(frame1, frame2, expected_device)
Within that function we can 1) assert frame is on device and 2) use the correct comparison function -- i.e. approximately equal for cuda and exactly equal for CPU
Thoughts?
As far as more tests are concerned, you (or I) can address those later. But let's align on the overall testing flow for cuda tests including testing the device and tensor values both.
This addresses comments:
https://github.com/pytorch/torchcodec/pull/319#discussion_r1822348889 https://github.com/pytorch/torchcodec/pull/319#discussion_r1822353651
I was not able to reuse the logic in the
needs_cuda()
decorator so I just duplicated that logic. If someone has better ideas let me know and I can incorporate them.