class_docstr: Test inputs and pre-processing.
docstr: Verifies that exception is raised if the weights shape is incorrect.
docstr_tok: ["Verifies","that","exception","is","raised","if","the","weights","shape","is","incorrect","."]
code: def test_exception_wrong_dim(self):
      """Verifies that exception is raised if the weights shape is incorrect."""
  
      n_wires = 1
      dev = qml.device("default.qubit", wires=n_wires)
  
      @qml.qnode(dev)
      def circuit(weights):
          qml.BasicEntanglerLayers(
              weights=weights, wires=range(n_wires)
          )
          return [qml.expval(qml.PauliZ(i)) for i in range(n_wires)]
  
      with pytest.raises(
          ValueError, match="Weights tensor must be 2-dimensional"
      ):
          circuit([1, 0])
  
      with pytest.raises(
          ValueError,
          match="Weights tensor must have last dimension of length",
      ):
          circuit([[1, 0], [1, 0]])
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 1 for calling the TestInputs obj's underlying member method code with example usage: obj.test_exception_wrong_dim() and returns: unknown