parameters: (self, x, name="get_dims")
docstring: Returns dimensions indexing `sample_shape`, `batch_shape`, `event_shape`.
  
      Example:
  
      ```python
      x = ...  # Tensor with shape [4, 3, 2, 1]
      sample_dims, batch_dims, event_dims = _DistributionShape(
        batch_ndims=2, event_ndims=1).get_dims(x)
      # sample_dims == [0]
      # batch_dims == [1, 2]
      # event_dims == [3]
      # Note that these are not the shape parts, but rather indexes into shape.
      ```
  
      Args:
        x: `Tensor`.
        name: Python `str`. The name to give this op.
  
      Returns:
        sample_dims: `Tensor` (1D, `int32`).
        batch_dims: `Tensor` (1D, `int32`).
        event_dims: `Tensor` (1D, `int32`).
docstring_summary: Returns dimensions indexing `sample_shape`, `batch_shape`, `event_shape`.
docstring_tokens: Returns dimensions indexing sample_shape batch_shape event_shape .
function: def get_dims(self, x, name="get_dims"):
      """Returns dimensions indexing `sample_shape`, `batch_shape`, `event_shape`.
  
      Example:
  
      ```python
      x = ...  # Tensor with shape [4, 3, 2, 1]
      sample_dims, batch_dims, event_dims = _DistributionShape(
        batch_ndims=2, event_ndims=1).get_dims(x)
      # sample_dims == [0]
      # batch_dims == [1, 2]
      # event_dims == [3]
      # Note that these are not the shape parts, but rather indexes into shape.
      ```
  
      Args:
        x: `Tensor`.
        name: Python `str`. 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"))
function_tokens: def get_dims ( self , x , name = "get_dims" ) : 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" ) )