code: def test_entmax_correct_multiple_alphas():
      n = 4
      x = torch.randn(n, 6, dtype=torch.float64, requires_grad=True)
      alpha = 0.05 + 2.5 * torch.rand(
          (n, 1), dtype=torch.float64, requires_grad=True
      )
  
      p1 = entmax_bisect(x, alpha)
      p2_ = [
          entmax_bisect(x[i].unsqueeze(0), alpha[i].item()).squeeze()
          for i in range(n)
      ]
      p2 = torch.stack(p2_)
  
      assert torch.allclose(p1, p2)
  
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 5 for calling a global function with example usage: test_entmax_correct_multiple_alphas() without return types