'Adds a layer that upscales the output by 2x through nearest neighbor interpolation'

def add_upscale(self):

    prev_shape = self.get_output().get_shape()
    size = [(2 * int(s)) for s in prev_shape[1:3]]
    out = tf.image.resize_nearest_neighbor(self.get_output(), size)
    self.outputs.append(out)
    return self
