from tensorflow.contrib.distributions.python.ops import distribution_util

      new_shape = array_ops.concat(0, ((-1,), batch_shape, event_shape))
      x = array_ops.reshape(x, shape=new_shape)
      x = distribution_util.rotate_transpose(x, shift=-1)
      return x, sample_shape
