pytorch
8f5ad00e - [JIT] Print out CU address in `ClassType::repr_str()` (#50194)

Commit
4 years ago
[JIT] Print out CU address in `ClassType::repr_str()` (#50194) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/50194 **Summary** `ClassType::repr_str()` prints out only the name of a `ClassType`, which is not always enough to disambiguate it. In some situations, two `ClassTypes` are compared and do not match despite having identical names because they are in separate compilation units. In such cases, the error message can seem nonsensical (e.g. `expected type T but found type T`). This commit modifies `ClassType::repr_str()` so that it prints out the address of the type's compilation unit to make these messages less puzzling (e.g. `expected type T (0x239023) but found type T (0x230223)`). **Test Plan** This commit adds a unit test, `ClassTypeTest.IdenticalTypesDifferentCus` that reproduces this situation. **Fixes** This commit fixes #46212. Test Plan: Imported from OSS Reviewed By: tugsbayasgalan Differential Revision: D25933082 Pulled By: SplitInfinity fbshipit-source-id: ec71b6728be816edd6a9c2b2d5075ead98d8bc88
Author
Meghan Lele
Parents
Loading