class_docstr: Test the TensorFlow interface execute function
  integrates well for both forward and backward execution
class_docstr_tok: ["Test","the","TensorFlow","interface","execute","function","integrates","well","for","both","forward","and","backward","execution"]
docstr: Test sampling works as expected
docstr_tok: ["Test","sampling","works","as","expected"]
code: def test_sampling(self, execute_kwargs):
      """Test sampling works as expected"""
      if (
          execute_kwargs["gradient_fn"] == "device"
          and execute_kwargs["grad_on_execution"] is True
      ):
          pytest.skip(
              "Adjoint differentiation does not support samples"
          )
  
      dev = qml.device("default.qubit.legacy", wires=2, shots=10)
  
      with tf.GradientTape():
          with qml.queuing.AnnotatedQueue() as q:
              qml.RY(tf.Variable(0.1), wires=0)
              qml.Hadamard(wires=[0])
              qml.CNOT(wires=[0, 1])
              qml.sample(qml.PauliZ(0))
              qml.sample(qml.PauliX(1))
  
          tape = qml.tape.QuantumScript.from_queue(q)
          res = execute([tape], dev, **execute_kwargs)[0]
          res = qml.math.stack(res)
  
      assert res.shape == (2, 10)
      assert isinstance(res, tf.Tensor)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.gradients import finite_diff, param_shift
  from pennylane import execute
label_desc: Use image node_id 13 for calling the TestTensorFlowExecuteIntegration obj's underlying member method code with example usage: obj.test_sampling(execute_kwargs) without return types