class_docstr: Unit tests for the pennylane.qnn.keras.KerasLayer class.
class_docstr_tok: ["Unit","tests","for","the","pennylane.qnn.keras.KerasLayer","class","."]
docstr: Test that everything works when default arguments that are not the input argument are
  present in the QNode
docstr_tok: ["Test","that","everything","works","when","default","arguments","that","are","not","the","input","argument","are","present","in","the","QNode"]
code: def test_non_input_defaults(self):  # pylint: disable=no-self-use
      """Test that everything works when default arguments that are not the input argument are
      present in the QNode"""
  
      n_qubits = 2
      output_dim = 2
  
      dev = qml.device("default.qubit", wires=n_qubits)
      w = {
          "w1": (3, n_qubits, 3),
          "w2": (1,),
          "w3": 1,
          "w4": [3],
          "w5": (2, n_qubits, 3),
          "w6": 3,
          "w7": 0,
      }
  
      @qml.qnode(dev, interface="tf")
      def c(
          inputs, w1, w2, w4, w5, w6, w7, w3=0.5
      ):  # pylint: disable=too-many-arguments
          """A circuit that embeds data using the AngleEmbedding and then performs a variety of
          operations. The output is a PauliZ measurement on the first output_dim qubits. One set of
          parameters, w5, are specified as non-trainable."""
          qml.templates.AngleEmbedding(
              inputs, wires=list(range(n_qubits))
          )
          qml.templates.StronglyEntanglingLayers(
              w1, wires=list(range(n_qubits))
          )
          qml.RX(w2[0], wires=0 % n_qubits)
          qml.RX(w3, wires=1 % n_qubits)
          qml.Rot(*w4, wires=2 % n_qubits)
          qml.templates.StronglyEntanglingLayers(
              w5, wires=list(range(n_qubits))
          )
          qml.Rot(*w6, wires=3 % n_qubits)
          qml.RX(w7, wires=4 % n_qubits)
          return [qml.expval(qml.PauliZ(i)) for i in range(output_dim)]
  
      layer = KerasLayer(c, w, output_dim=output_dim)
      x = tf.ones((2, n_qubits))
  
      layer_out = layer(x)
      circ_weights = layer.qnode_weights.copy()
      circ_weights["w4"] = tf.convert_to_tensor(
          circ_weights["w4"]
      )  # To allow for slicing
      circ_weights["w6"] = tf.convert_to_tensor(circ_weights["w6"])
      circuit_out = c(x[0], **circ_weights)
  
      assert np.allclose(layer_out, circuit_out)
  
imports: from collections import defaultdict
  import numpy
  import pytest
  import pennylane
label_desc: Use image node_id 9 for calling the TestKerasLayer obj's underlying member method code with example usage: obj.test_non_input_defaults() and returns: unknown