Commit 1e8f24ae authored by Abdullah Rashwan's avatar Abdullah Rashwan Committed by A. Unique TensorFlower
Browse files

Internal change

PiperOrigin-RevId: 365914010
parent 718b3070
...@@ -523,7 +523,7 @@ def nearest_upsampling(data, scale): ...@@ -523,7 +523,7 @@ def nearest_upsampling(data, scale):
w = shape[2] w = shape[2]
bs = -1 if bs is None else bs bs = -1 if bs is None else bs
# Uses reshape to quickly upsample the input. The nearest pixel is selected # Uses reshape to quickly upsample the input. The nearest pixel is selected
# implicitly via broadcasting. # via tiling.
data = tf.reshape(data, [bs, h, 1, w, 1, c]) * tf.ones( data = tf.tile(
[1, 1, scale, 1, scale, 1], dtype=data.dtype) tf.reshape(data, [bs, h, 1, w, 1, c]), [1, 1, scale, 1, scale, 1])
return tf.reshape(data, [bs, h * scale, w * scale, c]) return tf.reshape(data, [bs, h * scale, w * scale, c])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment