code: def _legacy_output_transform_func(
      *expr, out_mul=1.0, out_add=0.0, out_shrink=1, out_dtype=None
  ):
      if out_mul != 1.0:
          expr = [x * out_mul for x in expr]
  
      if out_add != 0.0:
          expr = [x + out_add for x in expr]
  
      if out_shrink > 1:
          ksize = [1, 1, out_shrink, out_shrink]
          expr = [
              tf.nn.avg_pool(
                  x,
                  ksize=ksize,
                  strides=ksize,
                  padding="VALID",
                  data_format="NCHW",
              )
              for x in expr
          ]
  
      if out_dtype is not None:
          if tf.as_dtype(out_dtype).is_integer:
              expr = [tf.round(x) for x in expr]
          expr = [tf.saturate_cast(x, out_dtype) for x in expr]
      return expr
  
imports: import types
  import inspect
  import re
  import uuid
  import sys
  import numpy
  import tensorflow
  from collections import OrderedDict
  from typing import Any, List, Tuple, Union
  from .None import tfutil
  from ..None import util
  from .tfutil import TfExpression, TfExpressionEx
label_desc: Use image node_id 3 for calling a global function with example usage: _legacy_output_transform_func() and returns: expr