code: def sigmoid(self):
      r"""Computes the sigmoid function using the following definition
  
      .. math::
          \sigma(x) = (1 + e^{-x})^{-1}
  
      If a valid method is given, this function will compute sigmoid
          using that method:
  
      "chebyshev" - computes tanh via Chebyshev approximation with
          truncation and uses the identity:
  
      .. math::
          \sigma(x) = \frac{1}{2}tanh(\frac{x}{2}) + \frac{1}{2}
  
      "reciprocal" - computes sigmoid using :math:`1 + e^{-x}` and computing
          the reciprocal
  
      """  # noqa: W605
      method = cfg.safety.mpc.functions.sigmoid_tanh_method
  
      if method == "chebyshev":
          tanh_approx = tanh(self.div(2))
          return tanh_approx.div(2) + 0.5
      elif method == "reciprocal":
          ltz = self._ltz()
          sign = 1 - 2 * ltz
  
          pos_input = self.mul(sign)
          denominator = pos_input.neg().exp().add(1)
  
          # TODO: Set these with configurable parameters
          with cfg.temp_override(
              {
                  "functions.exp_iterations": 9,
                  "functions.reciprocal_nr_iters": 3,
                  "functions.reciprocal_all_pos": True,
                  "functions.reciprocal_initial": 0.75,
              }
          ):
              pos_output = denominator.reciprocal()
  
          result = pos_output.where(1 - ltz, 1 - pos_output)
          # TODO: Support addition with different encoder scales
          # result = pos_output + ltz - 2 * pos_output * ltz
          return result
      else:
          raise ValueError(f"Unrecognized method {method} for sigmoid")
  
imports: import math
  import torch
  from fate.arch.protocol import mpc
  from ..common.util import chebyshev_series
  from ..config import cfg
label_desc: Use image node_id 10 for calling a global function with example usage: sigmoid() and returns: unknown, result