MCPcopy Create free account
hub / github.com/Kaggle/docker-python / test_grad

Method test_grad

tests/test_jax.py:18–21  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

16 return (1.0 - y) / (1.0 + y)
17
18 def test_grad(self):
19 grad_tanh = grad(self.tanh)
20 ag = grad_tanh(1.0)
21 self.assertEqual(0.4199743, ag)
22
23 def test_backend(self):
24 expected_backend = 'cpu' if not isGPU() else 'gpu'

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected