vak.common.validatorsΒΆ

Functions for input validation

Functions

column_or_1d(y[, warn])

ravel column or 1d numpy array, else raise an error

have_same_dtype(t1, t2[, name1, name2])

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

have_same_ndim(t1, t2[, name1, name2])

Validates that two tensors, t1 and t2, have the same :prop:`torch.Tensor.ndim`.

is_1d_or_2d_tensor(y[, name])

Validates that y is a one-dimension or two-dimensional torch.Tensor.

is_1d_tensor(t[, name])

Validate that input is a one-dimensional tensor

is_2d_tensor(t[, name])

Validate that input is a two-dimensional tensor

is_a_directory(path)

check if given path is a directory

is_a_file(path)

check if given path is a file

is_non_negative(boundary_times[, name])

Validates that y is a torch.Tensor with all non-negative (>=0.0) values.

is_strictly_increasing(boundary_times[, name])

Validates that y is a torch.Tensor with strictly increasing values.

row_or_1d(y[, warn])

ravel row or 1d numpy array, else raise an error