code: def test_can_construct_from_params(bimodal_encoder, params_dict):
      modules = dict(bimodal_encoder.named_modules())
      assert (
          len(modules["layers1"]) == params_dict["num_hidden_layers1"]
      )
      assert (
          len(modules["layers2"]) == params_dict["num_hidden_layers2"]
      )
  
file_path: allennlp/tests/modules/transformer/bimodal_encoder_test.py
imports: import torch
  from torch.testing import assert_allclose
  from transformers import AutoModel
  import pytest
  from allennlp.common import Params
  from allennlp.modules.transformer import BiModalEncoder
label_desc: Use image node_id 4 for calling a global function with example usage: test_can_construct_from_params(bimodal_encoder, params_dict) without return types