code: def test_mxmnet_global_message_passing():
      """Test for MXMNetGlobalMessagePassing Layer."""
      seed = 123
      torch.backends.cudnn.deterministic = True
      torch.backends.cudnn.benchmark = False
      torch.manual_seed(seed)
      torch.cuda.manual_seed_all(seed)
  
      dim = 1
      node_features = torch.tensor(
          [[0.8343], [1.2713], [1.2713], [1.2713], [1.2713]]
      )
  
      edge_attr = torch.tensor(
          [
              [1.0004],
              [1.0004],
              [1.0005],
              [1.0004],
              [1.0004],
              [-0.2644],
              [-0.2644],
              [-0.2644],
              [1.0004],
              [-0.2644],
              [-0.2644],
              [-0.2644],
              [1.0005],
              [-0.2644],
              [-0.2644],
              [-0.2644],
              [1.0004],
              [-0.2644],
              [-0.2644],
              [-0.2644],
          ]
      )
  
      edge_indices = torch.tensor(
          [
              [
                  0,
                  0,
                  0,
                  0,
                  1,
                  1,
                  1,
                  1,
                  2,
                  2,
                  2,
                  2,
                  3,
                  3,
                  3,
                  3,
                  4,
                  4,
                  4,
                  4,
              ],
              [
                  1,
                  2,
                  3,
                  4,
                  0,
                  2,
                  3,
                  4,
                  0,
                  1,
                  3,
                  4,
                  0,
                  1,
                  2,
                  4,
                  0,
                  1,
                  2,
                  3,
              ],
          ]
      )
  
      out = dc.models.torch_models.layers.MXMNetGlobalMessagePassing(
          dim
      )
      output = out(node_features, edge_attr, edge_indices)
      output = output.detach().numpy()
      result = np.array(
          [
              [-0.27947044],
              [2.417905],
              [2.417905],
              [2.4178727],
              [2.417905],
          ]
      )
      print(output)
      assert np.allclose(output, result, atol=1e-04)
      assert output.shape == (5, 1)
  
imports: import deepchem
  import numpy
  import pytest
  import os
label_desc: Use image node_id 54 for calling a global function with example usage: test_mxmnet_global_message_passing() without return types