code: def test_multi_head_self_attention_can_build_from_params(self):
      params = Params(
          {
              "num_heads": 3,
              "input_dim": 2,
              "attention_dim": 3,
              "values_dim": 6,
          }
      )
  
      encoder = MultiHeadSelfAttention.from_params(params)
      assert isinstance(encoder, MultiHeadSelfAttention)
      assert encoder.get_input_dim() == 2
      assert encoder.get_output_dim() == 2
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/modules/seq2seq_encoders/multi_head_self_attention_test.py
imports: from __future__ import absolute_import
  import numpy
  import torch
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.modules.seq2seq_encoders import MultiHeadSelfAttention
  from allennlp.common.params import Params
label_desc: Use image node_id 1 for calling the MultiHeadSelfAttentionTest obj's underlying member method code with example usage: obj.test_multi_head_self_attention_can_build_from_params() without return types