code: def test_infomax(device):
      def corruption(z):
          return z + 1
  
      model = DeepGraphInfomax(
          hidden_channels=16,
          encoder=lambda x: x,
          summary=lambda z, *args: z.mean(dim=0),
          corruption=lambda x: x + 1,
      ).to(device)
      assert str(model) == "DeepGraphInfomax(16)"
  
      x = torch.ones(20, 16, device=device)
  
      pos_z, neg_z, summary = model(x)
      assert pos_z.size() == (20, 16)
      assert neg_z.size() == (20, 16)
      assert summary.size() == (16,)
  
      loss = model.loss(pos_z, neg_z, summary)
      assert float(loss) >= 0
  
      if is_full_test():
          jit = torch.jit.export(model)
          pos_z, neg_z, summary = jit(x)
          assert pos_z.size() == (20, 16) and neg_z.size() == (20, 16)
          assert summary.size() == (16,)
  
      acc = model.test(
          train_z=torch.ones(20, 16),
          train_y=torch.randint(10, (20,)),
          test_z=torch.ones(20, 16),
          test_y=torch.randint(10, (20,)),
      )
      assert 0 <= acc <= 1
  
imports: import torch
  from torch_geometric.nn import GCN, DeepGraphInfomax
  from torch_geometric.testing import is_full_test, withCUDA
label_desc: Use image node_id 1 for calling a global function with example usage: test_infomax(device) and returns: unknown