code: def test_regex_matches_are_initialized_correctly(self):
      class Net(torch.nn.Module):
          def __init__(self):
              super(Net, self).__init__()
              self.linear_1_with_funky_name = torch.nn.Linear(5, 10)
              self.linear_2 = torch.nn.Linear(10, 5)
              self.conv = torch.nn.Conv1d(5, 5, 5)
  
          def forward(self, inputs):  # pylint: disable=arguments-differ
              pass
  
      # Make sure we handle regexes properly
      json_params = """{"initializer": [
          ["conv", {"type": "constant", "val": 5}],
          ["funky_na.*bi", {"type": "constant", "val": 7}]
          ]}
          """
      params = Params(
          json.loads(_jsonnet.evaluate_snippet("", json_params))
      )
      initializers = InitializerApplicator.from_params(
          params["initializer"]
      )
      model = Net()
      initializers(model)
  
      for parameter in model.conv.parameters():
          assert torch.equal(
              parameter.data, torch.ones(parameter.size()) * 5
          )
  
      parameter = model.linear_1_with_funky_name.bias
      assert torch.equal(
          parameter.data, torch.ones(parameter.size()) * 7
      )
  
imports: from __future__ import division
  from __future__ import with_statement
  from __future__ import absolute_import
  import json
  import logging
  import math
  import numpy
  import pytest
  import torch
  import _jsonnet
  from allennlp.nn import InitializerApplicator, Initializer
  from allennlp.nn.initializers import block_orthogonal, uniform_unit_scaling
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.common.params import Params
label_desc: Use image node_id 4 for calling the TestInitializers obj's underlying member method code with example usage: obj.test_regex_matches_are_initialized_correctly() without return types