class_docstr: Test cases for unary operators.
class_docstr_tok: ["Test","cases","for","unary","operators","."]
code: def testSoftplus(self):
      for dtype in self.float_types & {dtypes.float32, dtypes.float64}:
          self._assertSoftplusMatchesExpected([[-2, 0, 8]], dtype)
          self._assertSoftplusMatchesExpected(
              [[-9, 7, -5, 3, -1], [1, -3, 5, -7, 9]], dtype
          )
          if dtype == dtypes.bfloat16.as_numpy_dtype:
              log_eps = np.log(np.finfo(np.float32).eps)
          else:
              log_eps = np.log(np.finfo(dtype).eps)
          one = dtype(1)
          ten = dtype(10)
          self._assertSoftplusMatchesExpected(
              [
                  log_eps,
                  log_eps - one,
                  log_eps + one,
                  log_eps - ten,
                  log_eps + ten,
                  -log_eps,
                  -log_eps - one,
                  -log_eps + one,
                  -log_eps - ten,
                  -log_eps + ten,
              ],
              dtype,
          )
  
          self._assertSoftplusMatchesExpected(
              [0.69302183, 0.69324386],
              dtype,
              equality_test=self.AssertCloseAndSorted,
              rtol=9e-5,
              atol=9e-5,
          )
  
imports: import platform
  import unittest
  import numpy
  import six
  from tensorflow.compiler.tests import xla_test
  from tensorflow.python.framework import dtypes
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import bitwise_ops
  from tensorflow.python.ops import gen_functional_ops
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 33 for calling the UnaryOpsTest obj's underlying member method code with example usage: obj.testSoftplus() without return types