code: def test_can_construct_from_params(t5_attention, params_dict):
      assert (
          t5_attention.num_attention_heads == params_dict["num_heads"]
      )
      assert (
          t5_attention.attention_head_size
          == params_dict["key_value_proj_dim"]
      )
  
      assert (
          t5_attention.all_head_size
          == params_dict["num_heads"]
          * params_dict["key_value_proj_dim"]
      )
  
      assert (
          t5_attention.query.in_features == params_dict["hidden_size"]
      )
      assert t5_attention.key.in_features == params_dict["hidden_size"]
      assert (
          t5_attention.value.in_features == params_dict["hidden_size"]
      )
      assert (
          t5_attention.output.in_features == params_dict["hidden_size"]
      )
  
      assert t5_attention.dropout == params_dict["dropout"]
  
file_path: allennlp/tests/modules/transformer/t5_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 T5Attention
  from transformers.models.t5.configuration_t5 import T5Config
  from transformers.models.t5.modeling_t5 import T5Attention
  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(t5_attention, params_dict) without return types