2
0

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/d1ee2ec8709b21f2e72536cc14dba8ac2f8621ab/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>
Este cometimento está contido em:
Nicholas Curtis
2024-05-09 14:59:57 -04:00
cometido por Cole Ramos
ascendente 1f584c1612
cometimento 047d7771f3
+2
Ver ficheiro
@@ -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):