-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix import_optional_module function to return NoneType #597
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of returning sometimes returning NoneType
, would it be better to check if it's None
before isinstance
?
yeah that sounds better. i wonder if the metric_dict is the only place where that needs to be done. |
There are a few cases of that in the isinstance(X, (torch.Tensor, PackedSequence))
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #597 +/- ##
==========================================
- Coverage 75.15% 75.14% -0.01%
==========================================
Files 128 128
Lines 11394 11399 +5
==========================================
+ Hits 8563 8566 +3
- Misses 2831 2833 +2
|
PR Type ([Feature | Fix | Documentation | Test])
Fix
Short Description
The import_optional_module currently returns None when a module cannot be imported and the
error
parameter is set toignore
. When we useisinstance
this doesn't work, so introducing an option to returnNoneType
.Tests Added
...