code: def test_lstm_hid_init_layer_eval():
      # Test `hid_init` as a `Layer` with some dummy input. Compare the output of
      # a network with a `Layer` as input to `hid_init` to a network with a
      # `np.array` as input to `hid_init`
      n_units = 7
      n_test_cases = 2
      in_shp = (n_test_cases, 2, 3)
      in_h_shp = (1, n_units)
      in_cell_shp = (1, n_units)
  
      # dummy inputs
      X_test = np.ones(in_shp, dtype=theano.config.floatX)
      Xh_test = np.ones(in_h_shp, dtype=theano.config.floatX)
      Xc_test = np.ones(in_cell_shp, dtype=theano.config.floatX)
      Xh_test_batch = np.tile(Xh_test, (n_test_cases, 1))
      Xc_test_batch = np.tile(Xc_test, (n_test_cases, 1))
  
      # network with `Layer` initializer for hid_init
      l_inp = InputLayer(in_shp)
      l_inp_h = InputLayer(in_h_shp)
      l_inp_cell = InputLayer(in_cell_shp)
      l_rec_inp_layer = LSTMLayer(
          l_inp,
          n_units,
          hid_init=l_inp_h,
          cell_init=l_inp_cell,
          nonlinearity=None,
      )
  
      # network with `np.array` initializer for hid_init
      l_rec_nparray = LSTMLayer(
          l_inp,
          n_units,
          hid_init=Xh_test,
          cell_init=Xc_test,
          nonlinearity=None,
      )
  
      # copy network parameters from l_rec_inp_layer to l_rec_nparray
      l_il_param = dict(
          [(p.name, p) for p in l_rec_inp_layer.get_params()]
      )
      l_rn_param = dict(
          [(p.name, p) for p in l_rec_nparray.get_params()]
      )
      for k, v in l_rn_param.items():
          if k in l_il_param:
              v.set_value(l_il_param[k].get_value())
  
      # build the theano functions
      X = T.tensor3()
      Xh = T.matrix()
      Xc = T.matrix()
      output_inp_layer = lasagne.layers.get_output(
          l_rec_inp_layer, {l_inp: X, l_inp_h: Xh, l_inp_cell: Xc}
      )
      output_nparray = lasagne.layers.get_output(
          l_rec_nparray, {l_inp: X}
      )
  
      # test both nets with dummy input
      output_val_inp_layer = output_inp_layer.eval(
          {X: X_test, Xh: Xh_test_batch, Xc: Xc_test_batch}
      )
      output_val_nparray = output_nparray.eval({X: X_test})
  
      # check output given `Layer` is the same as with `np.array`
      assert np.allclose(output_val_inp_layer, output_val_nparray)
  
imports: import pytest
  from lasagne.layers import RecurrentLayer, LSTMLayer, CustomRecurrentLayer
  from lasagne.layers import InputLayer, DenseLayer, GRULayer, Gate, Layer
  from lasagne.layers import helper
  import theano
  import theano.tensor
  import numpy
  import lasagne
  from mock import Mock
label_desc: Use image node_id 30 for calling a global function with example usage: test_lstm_hid_init_layer_eval() without return types