class_docstr: Tests for the sample integration
class_docstr_tok: ["Tests","for","the","sample","integration"]
docstr: Test that the sample function outputs samples of the right size
docstr_tok: ["Test","that","the","sample","function","outputs","samples","of","the","right","size"]
code: def test_sample_dimension(self):
      """Test that the sample function outputs samples of the right size"""
      n_sample = 10
  
      dev = DefaultQubit()
  
      @qnode(dev, diff_method=None)
      def circuit():
          qml.RX(0.54, wires=0)
          return qml.sample(qml.PauliZ(0)), qml.sample(qml.PauliX(1))
  
      res = circuit(shots=n_sample)
  
      assert isinstance(res, tuple)
      assert len(res) == 2
  
      assert res[0].shape == (
          10,
      )  # pylint: disable=comparison-with-callable
      assert isinstance(res[0], np.ndarray)
  
      assert res[1].shape == (
          10,
      )  # pylint: disable=comparison-with-callable
      assert isinstance(res[1], np.ndarray)
  
imports: import autograd
  import autograd.numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane import qnode
  from pennylane.devices import DefaultQubit
label_desc: Use image node_id 2 for calling the TestSample obj's underlying member method code with example usage: obj.test_sample_dimension() and returns: qml,  qml