-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for torch.HalfTensor (#874)
* Add support for torch.HalfTensor. * Improvements/Simplifications for torch.HalfTensor. Improvements/Simplifications: 1) Defines half type as TH_Half, so as to not conflict with cutorch version. Previously, these were defined as the same "half" type and required proper ordering of includes to ensure type was only defined once, which would have affected all downstream projects. 2) No longer generates math functions that are not actually defined on torch.HalfTensor, e.g. maskedFill, map, etc. 3) Adds tests for all available torch.HalfTensor functions 4) Allows compiling without TH_GENERIC_USE_HALF (so if there's a problem can just unset that in CMakeLists rather than backing out) 5) Some simplifications: removes a new copy optimization and some TH_HALF literal definitions Limitations: Because match functions are not defined, some "non-math" operators on torch.HalfTensor give an error message, e.g. __index__/__newindex__ with a ByteTensor apply a mask, but masks aren't implemented. These limitations aren't always obvious, (e.g. for documentation purposes), but they should always give an error message. * Rename TH_HALF to THHalf.
- Loading branch information
Showing
40 changed files
with
872 additions
and
197 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
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
Oops, something went wrong.