code: def test_can_construct_from_params(self_attention, params_dict):
      assert (
          self_attention.num_attention_heads
          == params_dict["num_attention_heads"]
      )
      assert self_attention.attention_head_size == int(
          params_dict["hidden_size"]
          / params_dict["num_attention_heads"]
      )
  
      assert (
          self_attention.all_head_size
          == params_dict["num_attention_heads"]
          * self_attention.attention_head_size
      )
  
      assert (
          self_attention.query.in_features == params_dict["hidden_size"]
      )
      assert (
          self_attention.key.in_features == params_dict["hidden_size"]
      )
      assert (
          self_attention.value.in_features == params_dict["hidden_size"]
      )
  
      assert self_attention.dropout == params_dict["dropout"]
  
file_path: allennlp/tests/modules/transformer/self_attention_test.py
imports: import copy
  import torch
  import pytest
  from transformers import AutoModel
  from allennlp.common import Params
  from allennlp.modules.transformer.attention_module import SelfAttention
  from allennlp.nn.util import min_value_of_dtype
label_desc: Use image node_id 4 for calling a global function with example usage: test_can_construct_from_params(_attention, params_dict) without return types