class_docstr: A helper object to build a device infeed queue.
  
  The InfeedQueue builds the host-side and device-side Ops to enqueue and
  dequeue elements, respectively, and ensures that their types and
  shapes match.
class_docstr_tok: ["A","helper","object","to","build","a","device","infeed","queue",".","The","InfeedQueue","builds","the","host-side","and","device-side","Ops","to","enqueue","and","dequeue","elements",",","respectively",",","and","ensures","that","their","types","and","shapes","match","."]
docstr: 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.
code: def set_number_of_shards(self, number_of_shards):
      """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.
      """
      for policy in self._sharding_policies:
          policy.set_number_of_shards(number_of_shards)
          policy.set_number_of_partitions(self._number_of_partitions)
      self._validate()
  
imports: import itertools
  import numpy
  from tensorflow.python.compiler.xla.experimental import xla_sharding
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.ops import array_ops
  from tensorflow.python.tpu import tpu_name_util
  from tensorflow.python.tpu import tpu_sharding
  from tensorflow.python.tpu.ops import tpu_ops
  from tensorflow.python.util import nest
label_desc: Use image node_id 12 for calling the InfeedQueue obj's underlying member method code with example usage: obj.set_number_of_shards(number_of_shards) without return types