class_docstr: Test that tapes ending with expectations
  of Hamiltonians provide correct results and gradients
class_docstr_tok: ["Test","that","tapes","ending","with","expectations","of","Hamiltonians","provide","correct","results","and","gradients"]
code: def test_multiple_hamiltonians_not_trainable(
      self, cost_fn, execute_kwargs, tol
  ):
      # pylint: disable=unused-argument
      weights = tf.Variable([0.4, 0.5], dtype=tf.float64)
      coeffs1 = tf.constant([0.1, 0.2, 0.3], dtype=tf.float64)
      coeffs2 = tf.constant([0.7], dtype=tf.float64)
      dev = qml.device("default.qubit.legacy", wires=2)
  
      with tf.GradientTape() as tape:
          res = cost_fn(weights, coeffs1, coeffs2, dev=dev)
  
      expected = self.cost_fn_expected(weights, coeffs1, coeffs2)
      assert np.allclose(res, expected, atol=tol, rtol=0)
  
      res = tape.jacobian(res, [weights, coeffs1, coeffs2])
      expected = self.cost_fn_jacobian_expected(
          weights, coeffs1, coeffs2
      )
      assert np.allclose(res[0], expected[:, :2], atol=tol, rtol=0)
      assert res[1] is None
      assert res[2] is None
  
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 4 for calling the TestHamiltonianWorkflows obj's underlying member method code with example usage: obj.test_multiple_hamiltonians_not_trainable(cost_fn, execute_kwargs, tol) without return types