      for k in range(len(power_factors)):
          with tf.name_scope(None, 'Scale%d' % k, imgs):
              if k > 0:
                  # Avg pool takes rank 4 tensors. Flatten leading dimensions.
                  flat_imgs = [tf.reshape(x, tf.concat([[-1], t], 0))
                               for x, t in zip(imgs, tails)]
  
                  remainder = tails[0] % divisor_tensor
                  need_padding = tf.reduce_any(tf.not_equal(remainder, 0))
                  padded = tf.cond(need_padding,
                                   lambda: do_pad(flat_imgs, remainder),
                                   lambda: flat_imgs)
 
</s> remove                                  lambda: do_pad(flat_imgs, remainder),
                                 lambda: flat_imgs)
 </s> add                                  lambda: do_pad(flat_imgs, remainder), lambda: flat_imgs) </s> remove                 downscaled = [tf.nn.avg_pool(x, ksize=divisor, strides=divisor, padding='VALID')
                              for x in padded]
 </s> add                 downscaled = [tf.nn.avg_pool(x,
                                             ksize=divisor,
                                             strides=divisor,
                                             padding='VALID') for x in padded] </s> remove                 imgs = [tf.reshape(x, tf.concat([h, t], 0))
                        for x, h, t in zip(downscaled, heads, tails)]
 </s> add                 zipper = zip(downscaled, heads, tails)
                imgs = [tf.reshape(x, tf.concat([h, t], 0)) for x, h, t in zipper] </s> remove                 # Overwrite previous ssim value since we only need the last one.
                ssim_per_channel, c_s = _ssim_per_channel(*imgs, max_val=max_val)
                mc_s.append(tf.nn.relu(c_s))
 </s> add             # Overwrite previous ssim value since we only need the last one.
            ssim_per_channel, c_s = _ssim_per_channel(*imgs, max_val=max_val)
            mc_s.append(tf.nn.relu(c_s)) </s> remove         if (in_width % self.stride == 0):
 </s> add         if (in_width % self.stride) == 0:
                zipped = zip(imgs, tails)
                flat_imgs = [tf.reshape(x, tf.concat([[-1], t], 0)) for x, t in zipped]
      for k in range(len(power_factors)):
          with tf.name_scope(None, 'Scale%d' % k, imgs):
              if k > 0:
                  # Avg pool takes rank 4 tensors. Flatten leading dimensions.
                zipped = zip(imgs, tails)
                flat_imgs = [tf.reshape(x, tf.concat([[-1], t], 0)) for x, t in zipped]
                zipped = zip(imgs, tails)
                flat_imgs = [tf.reshape(x, tf.concat([[-1], t], 0)) for x, t in zipped]
                zipped = zip(imgs, tails)
                flat_imgs = [tf.reshape(x, tf.concat([[-1], t], 0)) for x, t in zipped]
                  remainder = tails[0] % divisor_tensor
                  need_padding = tf.reduce_any(tf.not_equal(remainder, 0))
                  padded = tf.cond(need_padding,
                                   lambda: do_pad(flat_imgs, remainder),
                                   lambda: flat_imgs)
keep keep keep keep replace replace replace keep keep keep keep keep
 documentation, pep8, style, clarity updates  - Prep for Segmentation (#812)

* documentation, pep8, style, clarity updates

* Update cli.py

* Update _config.py

remove extra mask and coverage

mask type as dropdown

* Update training_data.py

move coverage / LR to global
cut down on loss description

style change
losses working in PR

* simpler logging

* legacy update 
lib/model/losses.py