-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests for torch device and dtype utils (#2580)
### Changes This PR addresses #2579. - Add tests for torch device utils. The tests consider the case in which the model has no parameters, has all parameters on CPU, has all parameters on CUDA, and has parameters placed on different devices. In the latter, the parameters are moved on different devices randomly. - Add tests for torch `dtype` utils. The case in which the model has no parameters is also considered. - Created a test torch helper class `EmptyModel` to take into account the case in which the model has no parameters at all. - Add docstrings in utils. ### Tests I compared all the results manually checking for their correctness. The code is also compliant with the coding style having been verified with `pre-commit run` --------- Co-authored-by: Daniil Lyakhov <[email protected]>
- Loading branch information
1 parent
86ea8f6
commit 71cbe90
Showing
3 changed files
with
88 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters