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 the compute_output_shape method returns the expected shape
docstr_tok: ["Test","that","the","compute_output_shape","method","returns","the","expected","shape"]
code: def test_compute_output_shape_2(
      self, get_circuit, output_dim
  ):  # pylint: disable=no-self-use
      """Test that the compute_output_shape method returns the expected shape"""
      c, w = get_circuit
      layer = KerasLayer(c, w, output_dim)
  
      inputs = tf.keras.Input(shape=(2,))
      inputs_shape = inputs.shape
  
      output_shape = layer.compute_output_shape(inputs_shape)
      assert output_shape.as_list() == [None, 1]
  
imports: from collections import defaultdict
  import numpy
  import pytest
  import pennylane
label_desc: Use image node_id 20 for calling the TestKerasLayer obj's underlying member method code with example usage: obj.test_compute_output_shape_2(get_circuit, output_dim) without return types