diff --git a/ignite/contrib/handlers/time_profilers.py b/ignite/contrib/handlers/time_profilers.py index 81df27be8678..85046273a579 100644 --- a/ignite/contrib/handlers/time_profilers.py +++ b/ignite/contrib/handlers/time_profilers.py @@ -584,7 +584,7 @@ def get_results(self) -> List[List[Union[str, float]]]: total_eh_time = round(float(total_eh_time), 5,) def compute_basic_stats(data: Sequence) -> List[Union[str, float]]: - data = torch.tensor(data, dtype=torch.float32) + data = torch.as_tensor(data, dtype=torch.float32) # compute on non-zero data: data = data[data > 0] total = round(torch.sum(data).item(), 5) if len(data) > 0 else "not triggered"