pytorch
cde35b40 - [JIT] clarify errors due to non-literal indexing into ModuleList, ModuleDict (#98606)

Commit
1 year ago
[JIT] clarify errors due to non-literal indexing into ModuleList, ModuleDict (#98606) TorchScript only supports indexing into ModuleLists with integer literals. The error message already warns about this; but this PR adds clarifications around what a "literal" is. I'm adding this PR because, in my opinion, it's not obvious what a "literal" is and how strict its definition is. The clarification provided in this PR should make it easier for users to understand the issue and how to fix it. Pull Request resolved: https://github.com/pytorch/pytorch/pull/98606 Approved by: https://github.com/eellison, https://github.com/gmagogsfm
Author
Committer
Parents
Loading