Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Specialize optional tensor inputs to graphs in the JIT (#18360)
Summary: This specializes optional tensor inputs to either a DimensionedTensorType or, when None is passed, UndefinedTensor (aka AutogradZeroTensorType). This works because we already have different specs and thus separate plans for the two cases. It enhances the shape analysis - because now unwrapped optional tensors will have DimensionedTensorType with appropriate shape and required grad etc. Also, when combined with "if-pruning" (which I understand #18259 works towards), we actually get much nicer concrete graphs, too. Pull Request resolved: #18360 Differential Revision: D14590577 Pulled By: soumith fbshipit-source-id: cac204a506d1d38b15703cbcc67a6b75fd4979f4
- Loading branch information
1 parent
32d0e7e
commit 7cc7ed1
Showing
3 changed files
with
36 additions
and
1 deletion.
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