code: def test_entmax15(training, bisect_training):
      x = 0.5 * torch.randn(4, 6, dtype=torch.float32)
      p1 = entmax15(x, 1, training=training)
      p2 = entmax_bisect(x, alpha=1.5, training=bisect_training)
      assert torch.sum((p1 - p2) ** 2) < 1e-7
  
file_path: ludwig/tests/ludwig/utils/entmax/test_root_finding.py
imports: from functools import partial
  from itertools import product
  import pytest
  import torch
  from torch.autograd import gradcheck
  from ludwig.utils.entmax.activations import entmax15, sparsemax
  from ludwig.utils.entmax.root_finding import entmax_bisect, sparsemax_bisect
label_desc: Use image node_id 2 for calling a global function with example usage: test_entmax15(training, bisect_training) without return types