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 forward() method accepts a single input (i.e., not with an extra batch
  dimension) and returns a tensor of the right shape
docstr_tok: ["Test","if","the","forward","(",")","method","accepts","a","single","input","(","i.e.",",","not","with","an","extra","batch","dimension",")","and","returns","a","tensor","of","the","right","shape"]
code: def test_forward_single_input(
      self, get_circuit, output_dim, n_qubits
  ):  # pylint: disable=no-self-use
      """Test if the forward() method accepts a single input (i.e., not with an extra batch
      dimension) and returns a tensor of the right shape"""
      c, w = get_circuit
      layer = TorchLayer(c, w)
      x = torch.Tensor(np.ones(n_qubits))
  
      layer_out = layer.forward(x)
      assert layer_out.shape == torch.Size((output_dim,))
  
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 19 for calling the TestTorchLayer obj's underlying member method code with example usage: obj.test_forward_single_input(get_circuit, output_dim, n_qubits) without return types