code: def _fused_bias_act_ref(x, b, axis, act, alpha, gain):
      """Slow reference implementation of `fused_bias_act()` using standard TensorFlow ops."""
  
      # Validate arguments.
      x = tf.convert_to_tensor(x)
      b = (
          tf.convert_to_tensor(b)
          if b is not None
          else tf.constant([], dtype=x.dtype)
      )
      act_spec = activation_funcs[act]
      assert b.shape.rank == 1 and (
          b.shape[0] == 0 or b.shape[0] == x.shape[axis]
      )
      assert b.shape[0] == 0 or 0 <= axis < x.shape.rank
      if alpha is None:
          alpha = act_spec.def_alpha
      if gain is None:
          gain = act_spec.def_gain
  
      # Add bias.
      if b.shape[0] != 0:
          x += tf.reshape(
              b, [-1 if i == axis else 1 for i in range(x.shape.rank)]
          )
  
      # Evaluate activation function.
      x = act_spec.func(x, alpha=alpha)
  
      # Scale by gain.
      if gain != 1:
          x *= gain
      return x
  
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 3 for calling a global function with example usage: _fused_bias_act_ref(x, b, axis, act, alpha, gain) and returns: x