Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
fix via padding?
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Patrick Polster committed Dec 16, 2024
1 parent 2a261a4 commit d4aacb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/anemoi/models/preprocessing/remapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def transform(self, x: torch.Tensor, in_place: bool = True) -> torch.Tensor:
)

# create new tensor with target number of columns
x_remapped = torch.zeros(x.shape[:-1] + (target_number_columns,), dtype=x.dtype, device=x.device)
x_remapped = torch.nn.functional.pad(x, (0, target_number_columns - x.shape[-1]))
if in_place and not self.printed_preprocessor_warning:
LOGGER.warning(
"Remapper (preprocessor) called with in_place=True. This preprocessor cannot be applied in_place as new columns are added to the tensors.",
Expand Down

0 comments on commit d4aacb7

Please sign in to comment.