class_docstr: Tests the one-dimensional reconstruction subroutine based on equidistantly
  shifted evaluations for equidistant frequencies.
docstr: Test that the reconstruction of equidistant-frequency classical
  functions are differentiable for Torch input variables.
docstr_tok: ["Test","that","the","reconstruction","of","equidistant-frequency","classical","functions","are","differentiable","for","Torch","input","variables","."]
code: def test_differentiability_torch(
      self, fun, num_frequency, base_f, expected_grad
  ):
      """Test that the reconstruction of equidistant-frequency classical
      functions are differentiable for Torch input variables."""
      import torch
  
      # Convert fun to have integer frequencies
      _fun = lambda x: fun(x / base_f)
      _rec = _reconstruct_equ(_fun, num_frequency, interface="torch")
  
      # Convert reconstruction to have original frequencies
      rec = lambda x: _rec(base_f * x)
      grad = lambda x: torch.autograd.functional.jacobian(rec, x)
      assert fun_close(
          fun, rec, zero=torch.tensor(0.0, requires_grad=True)
      )
      assert fun_close(
          expected_grad,
          grad,
          zero=torch.tensor(0.0, requires_grad=True),
      )
  
imports: from inspect import signature
  from itertools import chain
  from functools import reduce
  import pytest
  import numpy
  import pennylane
  from pennylane import numpy
  from pennylane.fourier.reconstruct import _reconstruct_equ, _reconstruct_gen, _prepare_jobs, reconstruct
  from pennylane.fourier.utils import join_spectra
label_desc: Use image node_id 5 for calling the TestReconstructEqu obj's underlying member method code with example usage: obj.test_differentiability_torch(fun, num_frequency, base_f, expected_grad) without return types