pytorch
ca135ed6 - [PyTorch] Optimize TupleType::annotation_str_impl for small tuples (#97910)

Commit
1 year ago
[PyTorch] Optimize TupleType::annotation_str_impl for small tuples (#97910) In general, we can't profitably gather an array of all the elements' annotation strings so that we can reserve the final string because we'd have to heap-allocate that array. If we do it as a fast path for small tuples (which Tuple itself sets precedent for!), we can stack-allocate the array of annotation strings and make it profitable. Differential Revision: [D44519675](https://our.internmc.facebook.com/intern/diff/D44519675/) Pull Request resolved: https://github.com/pytorch/pytorch/pull/97910 Approved by: https://github.com/suo, https://github.com/Skylion007
Author
Committer
Parents
Loading