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 if the call() method performs correctly when the inputs argument is a default
  argument, i.e., that it outputs with shape (batch_size, output_dim) with results that
  agree with directly calling the QNode
docstr_tok: ["Test","if","the","call","(",")","method","performs","correctly","when","the","inputs","argument","is","a","default","argument",",","i.e.",",","that","it","outputs","with","shape","(","batch_size",",","output_dim",")","with","results","that","agree","with","directly","calling","the","QNode"]
code: def test_call_default_input(
      self, get_circuit, output_dim, batch_size, n_qubits
  ):  # pylint: disable=no-self-use
      """Test if the call() method performs correctly when the inputs argument is a default
      argument, i.e., that it outputs with shape (batch_size, output_dim) with results that
      agree with directly calling the QNode"""
      c, w = get_circuit
  
      @qml.qnode(
          qml.device("default.qubit", wires=n_qubits), interface="tf"
      )
      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 = KerasLayer(c_default, w, output_dim)
      x = tf.ones((batch_size, n_qubits))
  
      layer_out = layer(x)
      weights = [w.numpy() for w in layer.qnode_weights.values()]
  
      assert layer_out.shape == (batch_size, output_dim)
      assert np.allclose(layer_out[0], c(x[0], *weights), atol=1e-7)
  
imports: from collections import defaultdict
  import numpy
  import pytest
  import pennylane
label_desc: Use image node_id 15 for calling the TestKerasLayer obj's underlying member method code with example usage: obj.test_call_default_input(get_circuit, output_dim, batch_size, n_qubits) and returns: unknown