MCPcopy
hub / github.com/amazon-science/chronos-forecasting / validate_tensor

Function validate_tensor

test/util.py:9–14  ·  view source on GitHub ↗
(a: torch.Tensor, shape: Tuple[int, ...], dtype: Optional[torch.dtype] = None)

Source from the content-addressed store, hash-verified

7
8
9def validate_tensor(a: torch.Tensor, shape: Tuple[int, ...], dtype: Optional[torch.dtype] = None) -> None:
10 assert isinstance(a, torch.Tensor)
11 assert a.shape == shape
12
13 if dtype is not None:
14 assert a.dtype == dtype
15
16
17def create_df(series_ids=["A", "B"], n_points=[10, 10], target_cols=["target"], covariates=None, freq="h"):

Calls

no outgoing calls