code: def test_graph_encoder_layer_values():
      """
      Test to check the Values of the Graph Encoder Layer
      It first loads the weights of the TF model
      Then it starts transfering the weights to the torch model
          1. MultiConvolution Layer
              1.1 First Convolution Layer
              1.2 Rest of the Convolution Layers
          2. Aggregation Layer
      Then it loads the input tensors and checks the output
      """
      from deepchem.models.torch_models.layers import MolGANEncoderLayer
  
      nodes = 5
      edges = 5
      first_convolution_unit = 128
      second_convolution_unit = 64
      aggregation_unit = 128
      units = [
          (first_convolution_unit, second_convolution_unit),
          aggregation_unit,
      ]
  
      torch.manual_seed(21)
      tf_weights = np.load(
          "deepchem/models/tests/assets/molgan_encoder_layer_weights.npy",
          allow_pickle=True,
      ).item()
      torch_model_encoder = MolGANEncoderLayer(
          units=units, nodes=nodes, edges=edges, name="layer1"
      )
  
      x = 12  # the starting number for the dense layers in the tf model weights
      with torch.no_grad():
          # Testing MultiConvolution Layer
  
          # Testing First Convolution Layer
          # dense1 layer - list of dense layers
          for idx, dense in enumerate(
              torch_model_encoder.multi_graph_convolution_layer.first_convolution.dense1
          ):
              weight_name = f"layer1///dense_{idx+x}/kernel:0"
              bias_name = f"layer1///dense_{idx+x}/bias:0"
  
              dense.weight.data = torch.from_numpy(
                  np.transpose(tf_weights[weight_name])
              )
              dense.bias.data = torch.from_numpy(tf_weights[bias_name])
          idx += 1
  
          # dense2 layer - single dense layer
          torch_model_encoder.multi_graph_convolution_layer.first_convolution.dense2.weight.data = torch.from_numpy(
              np.transpose(
                  tf_weights[f"layer1///dense_{idx+x}/kernel:0"]
              )
          )
          torch_model_encoder.multi_graph_convolution_layer.first_convolution.dense2.bias.data = torch.from_numpy(
              tf_weights[f"layer1///dense_{idx+x}/bias:0"]
          )
          x += 5
  
          # Testing rest of the Multi convolution layer
          for idx_, layer in enumerate(
              torch_model_encoder.multi_graph_convolution_layer.gcl
          ):
              # dense1 layer - list of dense layers
              for idx, dense in enumerate(layer.dense1):
                  weight_name = f"layer1///dense_{idx+x}/kernel:0"
                  bias_name = f"layer1///dense_{idx+x}/bias:0"
                  dense.weight.data = torch.from_numpy(
                      np.transpose(tf_weights[weight_name])
                  )
                  dense.bias.data = torch.from_numpy(
                      tf_weights[bias_name]
                  )
              x += 1
  
              # dense2 layer - single dense layer
              layer.dense2.weight.data = torch.from_numpy(
                  np.transpose(
                      tf_weights[f"layer1///dense_{idx+x}/kernel:0"]
                  )
              )
              layer.dense2.bias.data = torch.from_numpy(
                  tf_weights[f"layer1///dense_{idx+x}/bias:0"]
              )
  
          # Testing Aggregation Layer
          torch_model_encoder.graph_aggregation_layer.d1.weight.data = (
              torch.from_numpy(
                  np.transpose(tf_weights["layer1//dense_22/kernel:0"])
              )
          )
          torch_model_encoder.graph_aggregation_layer.d1.bias.data = (
              torch.from_numpy(tf_weights["layer1//dense_22/bias:0"])
          )
          torch_model_encoder.graph_aggregation_layer.d2.weight.data = (
              torch.from_numpy(
                  np.transpose(tf_weights["layer1//dense_23/kernel:0"])
              )
          )
          torch_model_encoder.graph_aggregation_layer.d2.bias.data = (
              torch.from_numpy(tf_weights["layer1//dense_23/bias:0"])
          )
  
      # Loading input tensors
      adjacency_tensor = torch.from_numpy(
          np.load(
              "deepchem/models/tests/assets/molgan_adj_tensor.npy"
          ).astype(np.float32)
      )
      node_tensor = torch.from_numpy(
          np.load(
              "deepchem/models/tests/assets/molgan_nod_tensor.npy"
          ).astype(np.float32)
      )
  
      # Testing output
      output = torch_model_encoder([adjacency_tensor, node_tensor])
      output_tensor = torch.from_numpy(
          np.load(
              "deepchem/models/tests/assets/molgan_encoder_layer_op.npy"
          ).astype(np.float32)
      )
      assert torch.allclose(output, output_tensor, atol=1e-04)
  
file_path: deepchem/deepchem/models/torch_models/tests/test_molgan_layers.py
imports: import pytest
label_desc: Use image node_id 8 for calling a global function with example usage: test_graph_encoder_layer_values() without return types