vak.common.validators.have_same_ndim¶
- vak.common.validators.have_same_ndim(t1: Tensor, t2: Tensor, name1: str | None = None, name2: str | None = None) bool[source]¶
Validates that two tensors,
t1andt2, have the same :prop:`torch.Tensor.ndim`.- Parameters:
t1 (torch.Tensor) – First tensor to be validated.
t2 (torch.Tensor) – Second tensor to be validated.
name1 (str, optional) – Name of first tensor in calling function. Used in any error message if both
name1andname2are supplied.name2 (str, optional) – Name of second tensor in calling function. Used in any error message if both
name1andname2are supplied.
- Returns:
have_same_ndim – True if
arr1andarr2have the same :prop:`torch.Tensor.ndim`.- Return type: