code: def is_nonnegative(x: Tensor, atol: float = 1e-5) -> Tensor:
      """Return True if all elements of tensor are nonnegative within certain tolerance.
  
      Args:
          x: tensor
          atol: absolute tolerance
  
      Returns:
          Boolean tensor indicating if all values are nonnegative
  
      """
      return torch.logical_or(x > 0.0, torch.abs(x) < atol).all()
  
file_path: torchmetrics/src/torchmetrics/functional/clustering/utils.py
imports: from typing import Optional, Union
  import torch
  from torch import Tensor, tensor
  from typing_extensions import Literal
  from torchmetrics.utilities.checks import _check_same_shape
label_desc: Use image node_id 1 for calling a global function with example usage: is_nonnegative(x, atol) and returns: torch