code: def test_weight_init_value_the_same(self):
      gmm_w1 = self.switch_mlp_gmm.weight1.view(
          self.num_experts, -1, self.hidden_size
      )
      gmm_w2 = self.switch_mlp_gmm.weight2.view(
          self.num_experts, self.hidden_size, -1
      )
      gmm_expert1_fc1 = gmm_w1[0]
      gmm_expert1_fc2 = gmm_w2[0]
      gmm_expert2_fc1 = gmm_w1[1]
      gmm_expert2_fc2 = gmm_w2[1]
  
      smm_expert1_fc1 = self.switch_mlp_smm.local_experts[
          0
      ].linear_fc1.weight
      smm_expert1_fc2 = self.switch_mlp_smm.local_experts[
          0
      ].linear_fc2.weight
      smm_expert2_fc1 = self.switch_mlp_smm.local_experts[
          1
      ].linear_fc1.weight
      smm_expert2_fc2 = self.switch_mlp_smm.local_experts[
          1
      ].linear_fc2.weight
  
      assert torch.equal(gmm_expert1_fc1, smm_expert1_fc1)
      if not self.use_cpu_initialization:
          assert torch.equal(gmm_expert1_fc2, smm_expert1_fc2)
      # the param init value is not exactly the same between gmm and smm (refer to test_weight_init_value_the_same.)
      # TODO: is it necessary to keep smm and gmm share exactly the same init params?
      # assert torch.equal(gmm_expert2_fc1, smm_expert2_fc1)
      if self.use_cpu_initialization:
          assert torch.equal(gmm_expert2_fc2, smm_expert2_fc2)
  
file_path: megatron-lm/tests/unit_tests/transformer/moe/test_grouped_mlp.py
imports: import pytest
  import torch
  import torch.nn.functional
  from megatron.arguments import parse_args
  from megatron.core.models.gpt.gpt_layer_specs import get_gpt_layer_with_transformer_engine_spec
  from megatron.core.transformer.moe.grouped_mlp import GroupedMLP
  from megatron.core.transformer.moe.switch_mlp import SwitchMLP
  from megatron.core.transformer.transformer_config import TransformerConfig
  from megatron.initialize import _set_random_seed
  from megatron.model import Float16Module
  from tests.unit_tests.test_utilities import Utils
label_desc: Use image node_id 4 for calling the TestParallelGroupedMLP obj's underlying member method code with example usage: obj.test_weight_init_value_the_same() without return types