class_docstr: A distributed version of SparseDispatcher.
  
  Instead of one batch of input examples, we simultaneously process
  a list of num_datashards batches of input examples.  The per-expert
  `Tensor`s contain a combination of examples from the different datashards.
  
  Each datashard is associated with a particular device and each expert is
  associated with a particular device.  All per-datashard and per-expert
  `Tensor`s are created on those devices.  There is no single-device bottleneck.
class_docstr_tok: ["A","distributed","version","of","SparseDispatcher",".","Instead","of","one","batch","of","input","examples",",","we","simultaneously","process","a","list","of","num_datashards","batches","of","input","examples",".","The","per-expert","`","Tensor","`","s","contain","a","combination","of","examples","from","the","different","datashards",".","Each","datashard","is","associated","with","a","particular","device","and","each","expert","is","associated","with","a","particular","device",".","All","per-datashard","and","per-expert","`","Tensor","`","s","are","created","on","those","devices",".","There","is","no","single-device","bottleneck","."]
docstr: Create one input Tensor for each expert.
  
  Args:
    inp: a list of length num_datashards `Tensor`s with shapes
      `[batch_size[d], <extra_input_dims>]`.
  Returns:
    a list of `num_experts` `Tensor`s with shapes
      `[num_examples[i], <extra_input_dims>]`.
docstr_tok: ["Create","one","input","Tensor","for","each","expert",".","Args",":","inp",":","a","list","of","length","num_datashards","`","Tensor","`","s","with","shapes","`","[","batch_size","[","d","]",",","<","extra_input_dims",">","]","`",".","Returns",":","a","list","of","`","num_experts","`","`","Tensor","`","s","with","shapes","`","[","num_examples","[","i","]",",","<","extra_input_dims",">","]","`","."]
code: def dispatch(self, inp):
      """Create one input Tensor for each expert.
  
      Args:
        inp: a list of length num_datashards `Tensor`s with shapes
          `[batch_size[d], <extra_input_dims>]`.
      Returns:
        a list of `num_experts` `Tensor`s with shapes
          `[num_examples[i], <extra_input_dims>]`.
      """
      dispatched = self._dp(
          lambda a, b: a.dispatch(b), self._dispatchers, inp
      )
      ret = self._ep(tf.concat, transpose_list_of_lists(dispatched), 0)
      if ret[0].dtype == tf.float32:
          # see comments on common_layers.convert_gradient_to_tensor
          ret = self._ep(common_layers.convert_gradient_to_tensor, ret)
      return ret
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import math
  import six
  from six.moves import range
  from six.moves import zip
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers.vq_discrete import DiscreteBottleneck
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the DistributedSparseDispatcher obj's underlying member method code with example usage: obj.dispatch(inp) and returns: ret