Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
confusedmatrix committed Feb 28, 2024
1 parent 9560c12 commit f83a1cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ocf_datapipes/training/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,11 @@ def fill_nans_in_arrays(
Operation is performed in-place on the batch.
"""
for k, v in batch.items():
logger.info(k)
if isinstance(v, np.ndarray) and np.issubdtype(v.dtype, np.number):
if np.isnan(v).any():
logger.info(k)
_filled_keys.update({f"{_key_prefix}{k}"})
logger.info('filling nans')
logger.info(f'filling nans in {k}')
batch[k] = np.nan_to_num(v, copy=True, nan=0.0)

# Recursion is included to reach NWP arrays in subdict
Expand Down

0 comments on commit f83a1cd

Please sign in to comment.