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
{{ message }}
Repository navigation
TST/CLN: Fix warning about "copy construct from a tensor" caused by vak.metrics.distance.functional.character_error_rate #800
We get a warning in tests from vak.metrics.distance.functional.character_error_rate, basically because we call torch.tensor
tests/test_eval/test_frame_classification.py: 5 warningstests/test_learncurve/test_frame_classification.py: 8 warningstests/test_metrics/test_distance/test_functional.py: 6 warningstests/test_train/test_frame_classification.py: 4 warnings /home/ildefonso/Documents/repos/vocalpy/vak-vocalpy/src/vak/metrics/distance/functional.py:100: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor). return torch.tensor(rate, dtype=torch.float32)
I think the fix here is to do something like torch.FloatTensor instead of calling the torch.tensor constructor -- unless I'm confused the computed distance is a float, or maybe a numpy.float32?
I'm pretty sure we're not constructing from a tensor
Activity