tensorflow_probability/python/layers/internal/distribution_tensor_coercible.py
def _get_tensor_like_attributes():
  """Returns `Tensor` attributes related to shape and Python builtins."""
  # Enable "Tensor semantics" for distributions.
  # See tensorflow/python/framework/ops.py `class Tensor` for details.
  attrs = dict()
  # Setup overloadable operators and white-listed members / properties.
  attrs.update((attr, _wrap_method(tf.Tensor, attr))
               for attr in tf.Tensor.OVERLOADABLE_OPERATORS.union({'__iter__'}))
  # Copy some members straight-through.
  attrs.update((attr, getattr(tf.Tensor, attr))
               for attr in {'__nonzero__', '__bool__', '__array_priority__'})
  return attrs
def _get_tensor_like_attributes():
  """Returns `Tensor` attributes related to shape and Python builtins."""
  # Enable "Tensor semantics" for distributions.
  # See tensorflow/python/framework/ops.py `class Tensor` for details.
  attrs = dict()
  # Setup overloadable operators and white-listed members / properties.
  attrs.update((attr, _wrap_method(tf.Tensor, attr))
               for attr in tf.Tensor.OVERLOADABLE_OPERATORS.union({'__iter__'}))
  # Copy some members straight-through.
  attrs.update((attr, getattr(tf.Tensor, attr))
               for attr in {'__nonzero__', '__bool__', '__array_priority__'})
  return attrs
Returns `Tensor` attributes related to shape and Python builtins.