I/O Checks: Shape#
This module contains shape checkers for the inputs passed to the reader/writer.
- tad_mctc.io.checks.shape.shape_checks(numbers, positions, allow_batched=True)[source]#
Check the shapes of the numbers and positions tensors. This explicitly checks for non-batched tensor shapes (batched tensors throw errors).
- Parameters:
numbers (Tensor) – A 1D tensor containing atomic numbers or symbols.
positions (Tensor) – A 2D tensor of shape
(nat, 3)containing atomic positions.
- Returns:
True if the shapes are correct.
- Return type:
bool
- Raises:
ValueError – If the shapes of both tensors are inconsistent, the last dimension of the positions tensor is not 3 (cartesian directions), the numbers tensor has not one dimension, or the positions tensor has not two dimensions.