class_docstr: Hyperbolic tangent function.
class_docstr_tok: ["Hyperbolic","tangent","function","."]
code: def forward_gpu(self, x):
      if (
          chainer.should_use_cudnn("==always")
          and x[0].flags.c_contiguous
      ):
          y = cudnn.activation_forward(x[0], _mode)
          self.retain_inputs((0,))
          self._use_cudnn = True
      else:
          y = cuda.cupy.empty_like(x[0])
          cuda.cupy.tanh(x[0], out=y)
          self._use_cudnn = False
  
      self.retain_outputs((0,))
      return (y,)
  
imports: import numpy
  import chainer
  from chainer.backends import cuda
  from chainer import function_node
  from chainer import utils
  from chainer.utils import type_check
  import chainerx
label_desc: Use image node_id 4 for calling the Tanh obj's underlying member method code with example usage: obj.forward_gpu(x) and returns: y