code: def test_max(a, b, c):
      torch.manual_seed(0)
      t1 = torch.rand(a, 1, c).requires_grad_(True)
      t2 = torch.rand(1, b, c).requires_grad_(True)
      r1 = MaxSemiring.dot(t1, t2)
  
      t1a = torch.zeros(2, a, 1, c)
      t2a = torch.zeros(2, 1, b, c)
      t1a[0] = t1
      t2a[0] = t2
      t1a[1].fill_(-1e10)
      t2a[1].fill_(-1e10)
  
      r2 = KMaxSemiring(2).dot(t1a, t2a)
      assert torch.isclose(r1, r2[0]).all()
  
      (a, b) = torch.autograd.grad(r1.sum(), (t1, t2))
      (a2, b2) = torch.autograd.grad(r2[0].sum(), (t1a, t2a))
  
      assert torch.isclose(a, a2[0]).all()
      assert torch.isclose(b, b2[0]).all()
  
imports: import torch
  from hypothesis import given
  from hypothesis.strategies import integers
  from torch_struct import LogSemiring, CheckpointSemiring, CheckpointShardSemiring, KMaxSemiring, MaxSemiring, StdSemiring
label_desc: Use image node_id 1 for calling a global function with example usage: test_max(a, b, c) without return types