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 _evaluate_qnode() method works correctly when the inputs argument is a
  default argument, i.e., that it gives the same result as calling the QNode directly
docstr_tok: ["Test","if","the","_evaluate_qnode","(",")","method","works","correctly","when","the","inputs","argument","is","a","default","argument",",","i.e.",",","that","it","gives","the","same","result","as","calling","the","QNode","directly"]
code: def test_evaluate_qnode_default_input(
      self, get_circuit, output_dim, n_qubits
  ):  # pylint: disable=no-self-use
      """Test if the _evaluate_qnode() method works correctly when the inputs argument is a
      default argument, i.e., that it gives the same result as calling the QNode directly
      """
      c, w = get_circuit
  
      @qml.qnode(
          qml.device("default.qubit", wires=n_qubits), interface="torch"
      )
      def c_default(
          w1, w2, w3, w4, w5, w6, w7, inputs=None
      ):  # pylint: disable=too-many-arguments
          """Version of the circuit with inputs as a default argument"""
          qml.templates.AngleEmbedding(
              inputs, wires=list(range(n_qubits))
          )
          qml.templates.StronglyEntanglingLayers(
              w1, wires=list(range(n_qubits))
          )
          qml.RX(w2[0], wires=0)
          qml.RX(w3, wires=0)
          qml.Rot(*w4, wires=0)
          qml.templates.StronglyEntanglingLayers(
              w5, wires=list(range(n_qubits))
          )
          qml.Rot(*w6, wires=0)
          qml.RX(w7, wires=0)
          return [qml.expval(qml.PauliZ(i)) for i in range(output_dim)]
  
      layer = TorchLayer(c_default, w)
      x = torch.Tensor(np.ones(n_qubits))
  
      layer_out = layer._evaluate_qnode(
          x
      )  # pylint: disable=protected-access
      weights = layer.qnode_weights.values()
      circuit_out = torch.hstack(c(x, *weights)).type(x.dtype)
  
      assert torch.allclose(layer_out, circuit_out)
  
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 18 for calling the TestTorchLayer obj's underlying member method code with example usage: obj.test_evaluate_qnode_default_input(get_circuit, output_dim, n_qubits) and returns: unknown