code: def revnet_step(name, x, hparams, reverse=True):
    
    with tf.variable_scope(name, reuse=tf.AUTO_REUSE):
      if hparams.coupling == "additive":
        coupling_layer = functools.partial(
            additive_coupling, name="additive", reverse=reverse,
            mid_channels=hparams.coupling_width,
            activation=hparams.activation, dropout=hparams.coupling_dropout)
      else:
        coupling_layer = functools.partial(
            affine_coupling, name="affine", reverse=reverse,
            mid_channels=hparams.coupling_width,
            activation=hparams.activation, dropout=hparams.coupling_dropout)
      ops = [
          functools.partial(actnorm, name="actnorm", reverse=reverse),
          functools.partial(invertible_1x1_conv, name="invertible",
                            reverse=reverse), coupling_layer]
  
      if reverse:
        ops = ops[::-1]
  
      objective = 0.0
      for op in ops:
        x, curr_obj = op(x=x)
        objective += curr_obj
      return x, objective
docs: One step of glow generative flow.
  
    Actnorm + invertible 1X1 conv + affine_coupling.
  
    Args:
      name: used for variable scope.
      x: input
      hparams: coupling_width is the only hparam that is being used in
               this function.
      reverse: forward or reverse pass.
    Returns:
      z: Output of one step of reversible flow.