You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test is to prevent different visitors to use the same code accidentally. Using the same code with slightly different messages in the same visitor is fine, otherwise there will be not enough error codes soon (and also some messages are dynamic).
Issue
The test that checks whether there are any duplicate error codes never fails.
The TOR203 error code is defined three times and the test still passes:
https://github.com/pytorch-labs/torchfix/blob/main/torchfix/visitors/vision/singleton_import.py#L9
Root cause
The test itself checks if it has already seen the
TorchError
object, not the specific error code:https://github.com/pytorch-labs/torchfix/blob/main/tests/test_torchfix.py#L68
Because the object is initialised three times, the objects are distinct.
Solution
The test should check on the error code and the TorchError should only be initialised once in singleton import.
As a fix I'd like to directly address #6, by improving the TorchError data structure. (Already got the code)
The text was updated successfully, but these errors were encountered: