Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
nfarabullini committed Nov 26, 2024
1 parent eefd4ee commit bdd0298
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions model/common/src/icon4py/model/common/test_utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from gt4py.next import as_field, common as gt_common, constructors
from gt4py.next.ffront.decorator import Program

from icon4py.model.common.settings import xp

from ..grid.base import BaseGrid
from ..type_alias import wpfloat

Expand Down Expand Up @@ -103,7 +105,7 @@ def zero_field(
dtype=wpfloat,
extend: Optional[dict[gt_common.Dimension, int]] = None,
) -> gt_common.Field:
return as_field(dims, np.zeros(shape=_shape(grid, *dims, extend=extend), dtype=dtype))
return as_field(dims, xp.zeros(shape=_shape(grid, *dims, extend=extend), dtype=dtype))


def constant_field(
Expand Down Expand Up @@ -172,7 +174,7 @@ def _test_validation(self, grid, backend, input_data):
reference_outputs = self.reference(
grid,
**{
k: v.ndarray() if isinstance(v, gt_common.Field) else np.array(v)
k: v.asnumpy() if isinstance(v, gt_common.Field) else np.array(v)
for k, v in input_data.items()
},
)
Expand Down

0 comments on commit bdd0298

Please sign in to comment.