Skip to content

Commit

Permalink
moved GriddedDataset export to from_numpy and tests pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
iancze committed Dec 27, 2023
1 parent f8e4018 commit 386108c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/mpol/gridding.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import numpy.typing as npt
from fast_histogram import histogram as fast_hist

import torch

from mpol.coordinates import GridCoords
from mpol.exceptions import DataError, ThresholdExceededError, WrongDimensionError
from mpol.datasets import GriddedDataset
Expand Down Expand Up @@ -657,9 +659,9 @@ def to_pytorch_dataset(
return GriddedDataset(
coords=self.coords,
nchan=self.nchan,
vis_gridded=self.vis_gridded,
weight_gridded=self.weight_gridded,
mask=self.mask,
vis_gridded=torch.from_numpy(self.vis_gridded),
weight_gridded=torch.from_numpy(self.weight_gridded),
mask=torch.from_numpy(self.mask),
)


Expand Down

0 comments on commit 386108c

Please sign in to comment.