class_docstr: Integration tests for the pennylane.qnn.torch.TorchLayer class.
class_docstr_tok: ["Integration","tests","for","the","pennylane.qnn.torch.TorchLayer","class","."]
docstr: Test if the state dictionary output by the module contains all the expected trainable
  parameters
docstr_tok: ["Test","if","the","state","dictionary","output","by","the","module","contains","all","the","expected","trainable","parameters"]
code: def test_module_state_dict(
      self, module, get_circuit
  ):  # pylint: disable=redefined-outer-name,no-self-use
      """Test if the state dictionary output by the module contains all the expected trainable
      parameters"""
      _, w = get_circuit
  
      state_dict = module.state_dict()
      dict_keys = set(state_dict.keys())
  
      clayer_weights = set(f"clayer{i + 1}.weight" for i in range(3))
      clayer_biases = set(f"clayer{i + 1}.bias" for i in range(3))
      qlayer_params = set(
          f"qlayer{i + 1}.w{j + 1}"
          for i in range(2)
          for j in range(len(w))
      )
  
      all_params = clayer_weights | clayer_biases | qlayer_params
  
      assert dict_keys == all_params
      assert len(dict_keys) == len(all_params)
  
imports: from unittest import mock
  import math
  from collections import defaultdict
  import numpy
  import pytest
  import pennylane
  from pennylane.qnn.torch import TorchLayer
label_desc: Use image node_id 3 for calling the TestTorchLayerIntegration obj's underlying member method code with example usage: obj.test_module_state_dict(module, get_circuit) without return types