-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Automatically cast user inputs to inferred data type
- Add post-lowering pass to insert `aten::to` operators for Tensor inputs determined to require float or int inputs - Specifically, if the user provides an non-float input to a float-dtype input field and has `truncate_long_and_double=True`, a Torch-executed graph block will be inserted which casts that input to a float in-place. - This operation modifies user-provided tensors and provides a warning as such - Currently, the feature is only functional for Tensor inputs (not input signatures) and only casts to int and float types - if the input is specified as any other type, a cast will not be inserted - Modify compiler to extract inferred data types for each input - Add testing to ensure casts are inserted correctly and run in Torch
- Loading branch information
Showing
4 changed files
with
144 additions
and
24 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