class_docstr: Tests for LAX-backed Numpy reduction operations.
class_docstr_tok: ["Tests","for","LAX-backed","Numpy","reduction","operations","."]
code: def testNanStdGrad(self):
      # Regression test for https://github.com/google/jax/issues/8128
      x = jnp.arange(5.0).at[0].set(jnp.nan)
      y = jax.grad(jnp.nanvar)(x)
      self.assertAllClose(
          y,
          jnp.array([0.0, -0.75, -0.25, 0.25, 0.75]),
          check_dtypes=False,
      )
  
      z = jax.grad(jnp.nanstd)(x)
      self.assertEqual(jnp.isnan(z).sum(), 0)
  
imports: import collections
  from functools import partial
  import itertools
  import unittest
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  import jax
  from jax import numpy
  from jax._src import config
  from jax._src import dtypes
  from jax._src import test_util
  from jax._src.util import NumpyComplexWarning
label_desc: Use image node_id 15 for calling the JaxNumpyReducerTests obj's underlying member method code with example usage: obj.testNanStdGrad() without return types