code: def test_non_neg(Loss):
      for X, y in zip(Xs, ys):
          ls = Loss(reduction="none")
          lval = ls(X, y)
          assert torch.all(lval >= 0)
  
file_path: ludwig/tests/ludwig/utils/entmax/test_losses.py
imports: from functools import partial
  import pytest
  import torch
  from torch.autograd import gradcheck
  from ludwig.constants import IGNORE_INDEX_TOKEN_ID
  from ludwig.utils.entmax.losses import Entmax15Loss, EntmaxBisectLoss, SparsemaxBisectLoss, SparsemaxLoss
label_desc: Use image node_id 1 for calling a global function with example usage: test_non_neg(Loss) without return types