parameters: (tensor_type)
docstring: EXPERIMENTAL: Registers `tensor_type` as implementing the tensor interface.
  
    A "tensor-like type" can represent a single dense tensor, and implements
    the `name` and `dtype` properties.
  
    Args:
      tensor_type: A type implementing the tensor interface.
  
    Raises:
      TypeError: If `tensor_type` does not implement the tensor interface.
docstring_summary: EXPERIMENTAL: Registers `tensor_type` as implementing the tensor interface.
docstring_tokens: EXPERIMENTAL : Registers tensor_type as implementing the tensor interface .
function: def register_dense_tensor_like_type(tensor_type):
    """EXPERIMENTAL: Registers `tensor_type` as implementing the tensor interface.
  
    A "tensor-like type" can represent a single dense tensor, and implements
    the `name` and `dtype` properties.
  
    Args:
      tensor_type: A type implementing the tensor interface.
  
    Raises:
      TypeError: If `tensor_type` does not implement the tensor interface.
    """
    try:
      if not isinstance(tensor_type.name, property):
        raise TypeError("Type %s does not define a `name` property")
    except AttributeError:
      raise TypeError("Type %s does not define a `name` property")
    try:
      if not isinstance(tensor_type.dtype, property):
        raise TypeError("Type %s does not define a `dtype` property")
    except AttributeError:
      raise TypeError("Type %s does not define a `dtype` property")
    # We expect this list to be small, so choose quadratic complexity
    # for registration, so that we have a tuple that can be used for
    # more efficient `isinstance` checks later.
    global _TENSOR_LIKE_TYPES
    _TENSOR_LIKE_TYPES = tuple(list(_TENSOR_LIKE_TYPES) + [tensor_type])
function_tokens: def register_dense_tensor_like_type ( tensor_type ) : try : if not isinstance ( tensor_type . name , property ) : raise TypeError ( "Type %s does not define a `name` property" ) except AttributeError : raise TypeError ( "Type %s does not define a `name` property" ) try : if not isinstance ( tensor_type . dtype , property ) : raise TypeError ( "Type %s does not define a `dtype` property" ) except AttributeError : raise TypeError ( "Type %s does not define a `dtype` property" ) # We expect this list to be small, so choose quadratic complexity # for registration, so that we have a tuple that can be used for # more efficient `isinstance` checks later. global _TENSOR_LIKE_TYPES _TENSOR_LIKE_TYPES = tuple ( list ( _TENSOR_LIKE_TYPES ) + [ tensor_type ] )