diff --git a/phi/field/_field_math.py b/phi/field/_field_math.py index 899ef09d6..38234509e 100644 --- a/phi/field/_field_math.py +++ b/phi/field/_field_math.py @@ -762,7 +762,10 @@ def mean(field: Field, dim=lambda s: s.non_channel.non_batch) -> Tensor: Returns: `phi.Tensor` """ - result = math.mean(field.values, dim=dim) + if field.is_grid: + result = math.mean(field.values, dim=dim) + else: + result = math.mean(field.values, dim=dim, weight=field.geometry.volume) if (instance(field.geometry) & spatial(field.geometry)) in result.shape: return field.with_values(result) return result