check_for_nonfinite¶
- pytorch_forecasting.data.timeseries.check_for_nonfinite(tensor: torch.Tensor, names: Union[str, List[str]]) torch.Tensor [source]¶
Check if 2D tensor contains NAs or inifinite values.
- Parameters
names (Union[str, List[str]]) – name(s) of column(s) (used for error messages)
tensor (torch.Tensor) – tensor to check
- Returns
returns tensor if checks yield no issues
- Return type
torch.Tensor