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

Method set_number_of_shards

tensorflow/python/tpu/tpu_feed.py:349–362  ·  view source on GitHub ↗

Sets the number of shards to use for the InfeedQueue. Args: number_of_shards: number of ways to shard the InfeedQueue. Raises: ValueError: if number_of_shards is not > 0; or the policies have been frozen and number_of_shards was already set to something else.

(self, number_of_shards)

Source from the content-addressed store, hash-verified

347 return self._sharding_policies[0].number_of_shards
348
349 def set_number_of_shards(self, number_of_shards):
350 """Sets the number of shards to use for the InfeedQueue.
351
352 Args:
353 number_of_shards: number of ways to shard the InfeedQueue.
354
355 Raises:
356 ValueError: if number_of_shards is not > 0; or the policies have
357 been frozen and number_of_shards was already set to something
358 else.
359 """
360 for policy in self._sharding_policies:
361 policy.set_number_of_shards(number_of_shards)
362 self._validate()
363
364 def set_configuration_from_input_tensors(self, input_tensors):
365 """Sets the shapes and types of the queue tuple elements.

Callers 5

testModificationMethod · 0.95
testFreezingMethod · 0.95
body_wrapperFunction · 0.45

Calls 1

_validateMethod · 0.95

Tested by 2

testModificationMethod · 0.76
testFreezingMethod · 0.76