code: def test_complex():
      model = ComplEx(num_nodes=10, num_relations=5, hidden_channels=32)
      assert (
          str(model)
          == "ComplEx(10, num_relations=5, hidden_channels=32)"
      )
  
      head_index = torch.tensor([0, 2, 4, 6, 8])
      rel_type = torch.tensor([0, 1, 2, 3, 4])
      tail_index = torch.tensor([1, 3, 5, 7, 9])
  
      loader = model.loader(
          head_index, rel_type, tail_index, batch_size=5
      )
      for h, r, t in loader:
          out = model(h, r, t)
          assert out.size() == (5,)
  
          loss = model.loss(h, r, t)
          assert loss >= 0.0
  
          mean_rank, mrr, hits = model.test(
              h, r, t, batch_size=5, log=False
          )
          assert 0 <= mean_rank <= 10
          assert 0 < mrr <= 1
          assert hits == 1.0
  
label_desc: Use image node_id 2 for calling a global function with example usage: test_complex() without return types