code: def revnet(name, x, hparams, reverse=True):
    
    with tf.variable_scope(name, reuse=tf.AUTO_REUSE):
      steps = np.arange(hparams.depth)
      if reverse:
        steps = steps[::-1]
  
      objective = 0.0
      for step in steps:
        x, curr_obj = revnet_step(
            "revnet_step_%d" % step, x, hparams, reverse=reverse)
        objective += curr_obj
      return x, objective
docs: hparams.depth' steps of generative flow.
  
    Args:
      name: variable scope for the revnet block.
      x: 4-D Tensor, shape=(NHWC).
      hparams: HParams.
      reverse: bool, forward or backward pass.
    Returns:
      x: 4-D Tensor, shape=(NHWC).
      objective: float.