Add fix for case where we pass a single 'nan' value to to_avg

This is triggered by doing e.g., analyze -p <whatever> -k <kernel> -n per_kernel -b 17 18
Manifests as e.g.:

```
  ERROR [analysis] 'float' object has no attribute 'empty'
```

because of:

https://github.com/ROCm/omniperf/blob/f3a0360a5640e4539fac534f73876f51ddd268d0/src/utils/parser.py#L135

Instead, we first check whether numpy thinks the whole array is nan's, and bail early if so

Signed-off-by: Nicholas Curtis <nicurtis@amd.com>


[ROCm/rocprofiler-compute commit: 047d7771f3]
This commit is contained in:
Nicholas Curtis
2024-05-09 14:59:57 -04:00
committed by Cole Ramos
parent f7da503e6f
commit 8bd72673e8
@@ -132,6 +132,8 @@ def to_max(*args):
def to_avg(a):
if str(type(a)) == "<class 'NoneType'>":
return np.nan
elif np.isnan(a).all():
return np.nan
elif a.empty:
return np.nan
elif isinstance(a, pd.core.series.Series):