Checks that the configuration is self-consistent. Raises: ValueError: if the shapes and sharding policies don't match.
(self)
| 198 | self._validate() |
| 199 | |
| 200 | def _validate(self): |
| 201 | """Checks that the configuration is self-consistent. |
| 202 | |
| 203 | Raises: |
| 204 | ValueError: if the shapes and sharding policies don't match. |
| 205 | """ |
| 206 | if self.tuple_shapes is not None: |
| 207 | for (policy, shape) in zip(self._sharding_policies, self._tuple_shapes): |
| 208 | # Raise an error if the policy is incompatible with the shape. |
| 209 | _ = policy.get_sharded_shape(shape) |
| 210 | |
| 211 | @property |
| 212 | def number_of_tuple_elements(self): |
no test coverage detected