code: def mesh_axis_to_tensor_axis(self, mesh_ndims):
      
      ta2ma = self._tensor_axis_to_mesh_axis
      return tuple(
          [ta2ma.index(mesh_axis) if mesh_axis in ta2ma else None
           for mesh_axis in xrange(mesh_ndims)])
docs: For each mesh axis, which Tensor axis maps to it.
  
      Args:
        mesh_ndims: int.
  
      Returns:
        Tuple of optional integers, with length mesh_ndims.