mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Avoid logging zeros (#139968)
Summary: title Test Plan: NA Differential Revision: D65582953 Pull Request resolved: https://github.com/pytorch/pytorch/pull/139968 Approved by: https://github.com/zou3519
This commit is contained in:
committed by
PyTorch MergeBot
parent
216b6a952c
commit
f98c601efe
@ -162,12 +162,14 @@ class ReinplaceCounters:
|
||||
# Track sizes of known not re-inplaced tensors (exclude dynamic shapes).
|
||||
@classmethod
|
||||
def add_missed_bytes(cls, trigger: ReInplaceTrigger, bytes: int):
|
||||
cls._values[f"missed_bytes_{trigger.name}"] += bytes
|
||||
if bytes != 0:
|
||||
cls._values[f"missed_bytes_{trigger.name}"] += bytes
|
||||
|
||||
# Track number of not re-inplaced tensors.
|
||||
@classmethod
|
||||
def add_missed_opportunities(cls, trigger: ReInplaceTrigger, count: int):
|
||||
cls._values[f"missed_tensors_{trigger}"] += count
|
||||
if count != 0:
|
||||
cls._values[f"missed_tensors_{trigger}"] += count
|
||||
|
||||
@classmethod
|
||||
def clear(cls):
|
||||
|
Reference in New Issue
Block a user