def repeat_op(repetitions, inputs, op, *args, **kwargs):
 scope = kwargs.pop('scope', None)
 with tf.variable_scope(scope, 'RepeatOp', [inputs]):
  tower = inputs
  for _ in range(repetitions):
   tower = op(tower, *args, **kwargs)
  return tower

def repeat_op ( repetitions , inputs , op , * args , ** kwargs ) : scope = kwargs . pop ( 'scope' , None ) with tf . variable_scope ( scope , 'RepeatOp' , [ inputs ] ) : tower = inputs for _ in range ( repetitions ) : tower = op ( tower , * args , ** kwargs ) return tower
build a sequential tower starting from inputs by using an op repeatedly .