class_docstr: Test vector-valued returns for the JAX-JIT interface.
docstr: Tests the shape of vector-valued QNode results.
docstr_tok: ["Tests","the","shape","of","vector-valued","QNode","results","."]
code: def test_vector_valued_qnode(
      self, execute_kwargs, ret, out_dim, expected_type
  ):
      """Tests the shape of vector-valued QNode results."""
  
      dev = qml.device("default.qubit.legacy", wires=2)
      params = jax.numpy.array([0.1, 0.2, 0.3])
      grad_meth = (
          execute_kwargs["gradient_kwargs"]["method"]
          if "gradient_kwargs" in execute_kwargs
          else ""
      )
      if "adjoint" in grad_meth and any(
          r.return_type
          in (
              qml.measurements.Probability,
              qml.measurements.State,
              qml.measurements.Variance,
          )
          for r in ret
      ):
          pytest.skip("Adjoint does not support probs")
  
      def cost(a, cache):
          with qml.queuing.AnnotatedQueue() as q:
              qml.RY(a[0], wires=0)
              qml.RX(a[1], wires=0)
              qml.RY(a[2], wires=0)
  
              for r in ret:
                  qml.apply(r)
  
          tape = qml.tape.QuantumScript.from_queue(q)
  
          res = qml.execute([tape], dev, cache=cache, **execute_kwargs)[
              0
          ]
          return res
  
      res = jax.jit(cost, static_argnums=1)(params, cache=None)
  
      assert isinstance(res, expected_type)
      if expected_type is tuple:
          for r in res:
              assert r.shape == out_dim
      else:
          assert res.shape == out_dim
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.gradients import param_shift
  from pennylane import execute
label_desc: Use image node_id 3 for calling the TestVectorValuedJIT obj's underlying member method code with example usage: obj.test_vector_valued_qnode(execute_kwargs, ret, out_dim, expected_type) and returns: res