[V1] Check all pooling tasks during profiling (#21299)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-07-23 20:53:26 +08:00
committed by GitHub
parent 2671334d45
commit f59ec35b7f
2 changed files with 47 additions and 23 deletions

View File

@@ -1173,6 +1173,10 @@ class PoolingSequenceGroupOutput(
# The actual type is in SequenceGroup.pooled_data
data: Any
def get_data_nbytes(self) -> int:
data: torch.Tensor = self.data
return data.nbytes
def __repr__(self) -> str:
return f"PoolingSequenceGroupOutput(data={self.data}"
@@ -1234,6 +1238,9 @@ class PoolerOutput(
"""The output from a pooling operation in the pooling model."""
outputs: list[PoolingSequenceGroupOutput]
def get_data_nbytes(self) -> int:
return sum(o.get_data_nbytes() for o in self.outputs)
def __getitem__(self, idx: int) -> PoolingSequenceGroupOutput:
return self.outputs[idx]