parameters: (self, element)
docstring: r"""Check if `element` is present in tensor
  
          Args:
              element (Tensor or scalar): element to be checked
                  for presence in current tensor"
docstring_summary: r"""Check if `element` is present in tensor
docstring_tokens: r Check if element is present in tensor
function: def __contains__(self, element):
          r"""Check if `element` is present in tensor
  
          Args:
              element (Tensor or scalar): element to be checked
                  for presence in current tensor"
          """
          if has_torch_function_unary(self):
              return handle_torch_function(Tensor.__contains__, (self,), self, element)
          if isinstance(element, (torch.Tensor, Number)):
              # type hint doesn't understand the __contains__ result array
              return (element == self).any().item()  # type: ignore[union-attr]
  
          raise RuntimeError(
              "Tensor.__contains__ only supports Tensor or scalar, but you passed in a %s." %
              type(element)
          )
function_tokens: def __contains__ ( self , element ) : if has_torch_function_unary ( self ) : return handle_torch_function ( Tensor . __contains__ , ( self , ) , self , element ) if isinstance ( element , ( torch . Tensor , Number ) ) : # type hint doesn't understand the __contains__ result array return ( element == self ) . any ( ) . item ( ) # type: ignore[union-attr] raise RuntimeError ( "Tensor.__contains__ only supports Tensor or scalar, but you passed in a %s." % type ( element ) )