class_docstr: Test ParametrizedHamiltonian with ML interfaces.
docstr: Test result of calling the ParametrizedHamiltonian works with
  parameters as a torch tensor
docstr_tok: ["Test","result","of","calling","the","ParametrizedHamiltonian","works","with","parameters","as","a","torch","tensor"]
code: def test_call_torch(self):
      """Test result of calling the ParametrizedHamiltonian works with
      parameters as a torch tensor"""
      import torch
  
      pH = ParametrizedHamiltonian(
          [1.2, f1, 2.3, f2], [qml.PauliX(i) for i in range(4)]
      )
      params = torch.Tensor([4.5, 6.7])
      t = 2
      op = pH(params, t)
  
      assert isinstance(op, qml.ops.Sum)
      assert len(op) == 2
  
      H_fixed = op[0]
      H_parametrized = op[1]
      expected_H_fixed = qml.sum(
          qml.s_prod(1.2, qml.PauliX(0)), qml.s_prod(2.3, qml.PauliX(2))
      )
      expected_H_parametrized = qml.sum(
          qml.s_prod(f1(params[0], t), qml.PauliX(1)),
          qml.s_prod(f2(params[1], t), qml.PauliX(3)),
      )
  
      assert qml.equal(H_fixed, expected_H_fixed)
      assert qml.equal(H_parametrized, expected_H_parametrized)
  
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.pulse import ParametrizedHamiltonian
  from pennylane.wires import Wires
label_desc: Use image node_id 2 for calling the TestInterfaces obj's underlying member method code with example usage: obj.test_call_torch() without return types