dgs.utils.validation.validate_ids¶
- dgs.utils.validation.validate_ids(ids: int | torch.Tensor, length: int | None = None) torch.Tensor [source]¶
Validate a given tensor or single integer value.
- Parameters:
ids – Arbitrary torch tensor to check.
length – The number of items or batch-size the tensor should have. Default None does not validate the length.
- Returns:
Torch integer tensor with one dimension.
- Return type:
torch.Tensor
- Raises:
TypeError – If ids is not a torch.Tensor.