(ema)
return _custom_getter
Makes variable scope custom getter.
Makes variable scope custom getter.
Makes variable scope custom getter .
def make_var_scope_custom_getter_for_ema(ema):
  """Makes variable scope custom getter."""

  def _custom_getter(getter, name, *args, **kwargs):
    var = getter(name, *args, **kwargs)
    ema_var = ema.average(var)
    return ema_var if ema_var else var

  return _custom_getter
def make_var_scope_custom_getter_for_ema ( ema ) : def _custom_getter ( getter , name , * args , * * kwargs ) : var = getter ( name , * args , * * kwargs ) ema_var = ema . average ( var ) return ema_var if ema_var else var return _custom_getter