MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _validate

Method _validate

tensorflow/python/tpu/tpu_feed.py:200–209  ·  view source on GitHub ↗

Checks that the configuration is self-consistent. Raises: ValueError: if the shapes and sharding policies don't match.

(self)

Source from the content-addressed store, hash-verified

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):

Callers 5

__init__Method · 0.95
set_tuple_shapesMethod · 0.95
set_shard_dimensionsMethod · 0.95
set_number_of_shardsMethod · 0.95
freezeMethod · 0.95

Calls 1

get_sharded_shapeMethod · 0.80

Tested by

no test coverage detected