MCPcopy Create free account
hub / github.com/allenai/molmoact2 / _stats_reference_array

Function _stats_reference_array

experiments/olmo/data/robot_processing.py:59–69  ·  view source on GitHub ↗
(stats: Optional[Mapping[str, Any]])

Source from the content-addressed store, hash-verified

57
58
59def _stats_reference_array(stats: Optional[Mapping[str, Any]]) -> Optional[np.ndarray]:
60 if not isinstance(stats, Mapping):
61 return None
62 for key in ("mean", "std", "min", "max", "q01", "q99", "q10", "q90", "mask"):
63 value = stats.get(key)
64 if value is None:
65 continue
66 arr = _to_array(value)
67 if arr is not None and getattr(arr, "shape", None):
68 return arr
69 return None
70
71
72def _normalize_array(

Callers 1

from_statsMethod · 0.85

Calls 2

_to_arrayFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected