def residual_dropout(inputs, output, dropout, training):
  """out = inputs + dropout(output)."""
  if training and dropout:
    output = tf.nn.dropout(output, dropout)
  output += inputs
  return output