mirror of
https://github.com/deepspeedai/DeepSpeed.git
synced 2025-10-20 15:33:51 +08:00
Fix assert when 'pp_int' object has no attribute 'custom_print_str' (#7507)
Fix assert `'pp_int' object has no attribute 'custom_print_str'` when tracking deepspeed module with some track debug tools like [objwatch](https://github.com/aeeeeeep/objwatch) ```python3 import objwatch objwatch.watch(targets=[deepspeed], framework="torch.distributed", indexes=[0,], with_locals=True) ``` Signed-off-by: aeeeeeep <aeeeeeep@proton.me>
This commit is contained in:
@ -137,7 +137,7 @@ class pp_int(int):
|
||||
return inst
|
||||
|
||||
def __repr__(self):
|
||||
if self.custom_print_str:
|
||||
if hasattr(self, "custom_print_str") and self.custom_print_str:
|
||||
return self.custom_print_str
|
||||
return f"{self.real:,}"
|
||||
|
||||
|
Reference in New Issue
Block a user