code: def fused_bias_act(
      x,
      b=None,
      axis=1,
      act="linear",
      alpha=None,
      gain=None,
      impl="cuda",
  ):
      r"""Fused bias and activation function.
  
      Adds bias `b` to activation tensor `x`, evaluates activation function `act`,
      and scales the result by `gain`. Each of the steps is optional. In most cases,
      the fused op is considerably more efficient than performing the same calculation
      using standard TensorFlow ops. It supports first and second order gradients,
      but not third order gradients.
  
      Args:
          x:      Input activation tensor. Can have any shape, but if `b` is defined, the
                  dimension corresponding to `axis`, as well as the rank, must be known.
          b:      Bias vector, or `None` to disable. Must be a 1D tensor of the same type
                  as `x`. The shape must be known, and it must match the dimension of `x`
                  corresponding to `axis`.
          axis:   The dimension in `x` corresponding to the elements of `b`.
                  The value of `axis` is ignored if `b` is not specified.
          act:    Name of the activation function to evaluate, or `"linear"` to disable.
                  Can be e.g. `"relu"`, `"lrelu"`, `"tanh"`, `"sigmoid"`, `"swish"`, etc.
                  See `activation_funcs` for a full list. `None` is not allowed.
          alpha:  Shape parameter for the activation function, or `None` to use the default.
          gain:   Scaling factor for the output tensor, or `None` to use default.
                  See `activation_funcs` for the default scaling of each activation function.
                  If unsure, consider specifying `1.0`.
          impl:   Name of the implementation to use. Can be `"ref"` or `"cuda"` (default).
  
      Returns:
          Tensor of the same shape and datatype as `x`.
      """
  
      impl_dict = {
          "ref": _fused_bias_act_ref,
          "cuda": _fused_bias_act_cuda,
      }
      return impl_dict[impl](
          x=x, b=b, axis=axis, act=act, alpha=alpha, gain=gain
      )
  
file_path: insightface/reconstruction/ostec/external/stylegan2/dnnlib/tflib/ops/fused_bias_act.py
imports: import os
  import numpy
  import tensorflow
  from ..None import custom_ops
  from ...util import EasyDict
label_desc: Use image node_id 2 for calling a global function with example usage: fused_bias_act(x, b, axis, act, alpha, gain, impl) and returns: impl_dict