code: def test_tie_mlm_head_weight_to_encoder(self):
      self._text_modality_config = MMFTransformerModalityConfig(
          type="text",
          key="text",
          embedding_dim=768,
          position_dim=128,
          segment_id=0,
          encoder=TextEncoderFactory.Config(
              type=TextEncoderTypes.transformer
          ),
      )
      heads = [MLM.Config()]
      modalities_config = [
          self._image_modality_config,
          self._text_modality_config,
      ]
      config = MMFTransformer.Config(
          heads=heads,
          modalities=modalities_config,
          num_labels=2,
          tie_weight_to_encoder="text",
      )
      mmft = build_model(config)
  
      test_utils.compare_tensors(
          mmft.heads[0].cls.predictions.decoder.weight,
          mmft.encoders["text"].embeddings.word_embeddings.weight,
      )
  
imports: import gc
  import unittest
  import tests.test_utils
  import torch
  from mmf.common.sample import SampleList
  from mmf.models.mmf_transformer import MMFTransformer, MMFTransformerModalityConfig
  from mmf.models.transformers.heads.mlm import MLM
  from mmf.modules.encoders import EncoderFactory, IdentityEncoder, ImageEncoderFactory, ImageEncoderTypes, ResNet152ImageEncoder, TextEncoderFactory, TextEncoderTypes
  from mmf.utils.build import build_model
  from mmf.utils.configuration import Configuration
  from mmf.utils.env import setup_imports, teardown_imports
  from omegaconf import OmegaConf
  from tests.test_utils import skip_if_no_pytorchvideo
label_desc: Use image node_id 10 for calling the TestMMFTransformer obj's underlying member method code with example usage: obj.test_tie_mlm_head_weight_to_encoder() without return types