class_docstr: Unit tests for the pennylane.qnn.torch.TorchLayer class.
class_docstr_tok: ["Unit","tests","for","the","pennylane.qnn.torch.TorchLayer","class","."]
docstr: Test if the weights in qnode_weights have the correct shape
docstr_tok: ["Test","if","the","weights","in","qnode_weights","have","the","correct","shape"]
code: def test_qnode_weights_shapes(
      self, get_circuit, n_qubits
  ):  # pylint: disable=no-self-use
      """Test if the weights in qnode_weights have the correct shape"""
      c, w = get_circuit
      layer = TorchLayer(c, w)
  
      ideal_shapes = {
          "w1": torch.Size((3, n_qubits, 3)),
          "w2": torch.Size((1,)),
          "w3": torch.Size([]),
          "w4": torch.Size((3,)),
          "w5": torch.Size((2, n_qubits, 3)),
          "w6": torch.Size((3,)),
          "w7": torch.Size([]),
      }
  
      for name, weight in layer.qnode_weights.items():
          assert weight.shape == ideal_shapes[name]
  
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 14 for calling the TestTorchLayer obj's underlying member method code with example usage: obj.test_qnode_weights_shapes(get_circuit, n_qubits) without return types