vak.common.validators.have_same_dtype

vak.common.validators.have_same_dtype(t1: Tensor, t2: Tensor, name1: str | None = None, name2: str | None = None) bool[source]

Validates that two tensors, t1 and t2, have the same dtype.

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 name1 and name2 are supplied.

  • name2 (str, optional) – Name of second tensor in calling function. Used in any error message if both name1 and name2 are supplied.

Returns:

have_same_dtype – True if arr1 and arr2 have the same dtype.

Return type:

bool