'Reshuffles input `Tensor`s to produce output `Tensor`s.
The dimensions of all input and output `Tensor`s match, except for
dimension 0.  In dimension 0, the input `Tensor`s match the corresponding
`gates` `Tensor`s which were passed to the constructor.
Args:
d_tensors: a list of `Tensor`s, one per datashard.
Returns:
a list of `Tensor`s, one per expert.'

def Dispatch(self, d_tensors):

    parts = self._data_parallelism(tf.dynamic_partition, d_tensors, self._gates, self._model_parallelism.n)
    parts_by_expert = TransposeListOfLists(parts)
    x_tensors = self._model_parallelism(tf.concat, parts_by_expert, 0)
    return x_tensors
