code: def testGradients(self):
      shape = [5, 3, 4]
      sigma = 5
      input_values = np.random.randn(*shape) * sigma
      x_tf = _get_weak_tensor(input_values)
      with self.cached_session():
  
          def f(x):  # pylint: disable=invalid-name
              return nn_impl.swish(x)
  
          theoretical, numerical = gradient_checker_v2.compute_gradient(
              f, [x_tf]
          )
          self.assertAllClose(theoretical, numerical)
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.framework import weak_tensor
  from tensorflow.python.ops import gradient_checker_v2
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_impl
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops import weak_tensor_ops
  from tensorflow.python.ops import weak_tensor_test_util
  import tensorflow.python.ops.nn_grad
  from tensorflow.python.platform import test
label_desc: Use image node_id 3 for calling the SwishTest obj's underlying member method code with example usage: obj.testGradients() and returns: nn_impl