docstr: Test that gradients are correct when the dynamics depend on t.
docstr_tok: ["Test","that","gradients","are","correct","when","the","dynamics","depend","on","t","."]
code: def test_weird_time_pendulum_grads(self):
      """Test that gradients are correct when the dynamics depend on t."""
  
      def dynamics(_np, y, t):
          return _np.array([y[1] * -t, -1 * y[1] - 9.8 * _np.sin(y[0])])
  
      y0 = [np.pi - 0.1, 0.0]
      ts = np.linspace(0.0, 1.0, 11)
      tol = 1e-1 if jtu.num_float_bits(np.float64) == 32 else 1e-3
  
      self.check_against_scipy(dynamics, y0, ts, tol=tol)
  
      integrate = partial(odeint, partial(dynamics, jnp))
      jtu.check_grads(
          integrate,
          (y0, ts),
          modes=["rev"],
          order=2,
          rtol=tol,
          atol=tol,
      )
  
imports: from functools import partial
  from absl.testing import absltest
  import numpy
  import jax
  from jax._src import test_util
  import jax.numpy
  from jax.experimental.ode import odeint
  from jax.tree_util import tree_map
  import scipy.integrate
  from jax import config
label_desc: Use image node_id 4 for calling the ODETest obj's underlying member method code with example usage: obj.test_weird_time_pendulum_grads() and returns: _np