from tensorflow.python.framework import tensor_util

      name: `String`. The name to give this op.

    Returns:
      sample_dims: `Tensor` (1D, `int32`).
      batch_dims: `Tensor` (1D, `int32`).
      event_dims: `Tensor` (1D, `int32`).
    """
    with self._name_scope(name, values=[x]):
      def make_dims(start_sum, size, name):
        """Closure to make dims range."""
        start_sum = start_sum if start_sum else (
            array_ops.zeros((), dtype=dtypes.int32, name="zero"),)
        if self._is_all_constant_helper(size, *start_sum):
          start = sum(tensor_util.constant_value(s) for s in start_sum)
          stop = start + tensor_util.constant_value(size)
          return ops.convert_to_tensor(
              list(range(start, stop)), dtype=dtypes.int32, name=name)
        else:
          start = sum(start_sum)
          return math_ops.range(start, start + size)
      sample_ndims = self.get_sample_ndims(x, name=name)
      return (make_dims((), sample_ndims, name="sample_dims"),
              make_dims((sample_ndims,), self.batch_ndims, name="batch_dims"),
              make_dims((sample_ndims, self.batch_ndims),
                        self.event_ndims, name="event_dims"))

  def get_shape(self, x, name="get_shape"):
    """Returns `Tensor`'s shape partitioned into `sample`, `batch`, `event`.
