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