code: def _summarize_fans(fan_in, fan_out, mode, dtype):
      """Combines `fan_in`, `fan_out` per specified `mode`."""
      fan_in = prefer_static.cast(fan_in, dtype)
      fan_out = prefer_static.cast(fan_out, dtype)
      mode = str(mode).lower()
      if mode == "fan_in":
          return fan_in
      elif mode == "fan_out":
          return fan_out
      elif mode == "fan_avg":
          return (fan_in + fan_out) / 2.0
      raise ValueError('Unrecognized mode: "{}".'.format(mode))
  
file_path: probability/tensorflow_probability/python/experimental/nn/initializers/initializers.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
label_desc: Use image node_id 7 for calling a global function with example usage: _summarize_fans(fan_in, fan_out, mode, dtype) and returns: fan_in, fan_out, unknown