def SubPixel1D(I, r):
    'One-dimensional subpixel upsampling layer\n\n  Calls a tensorflow function that directly implements this functionality.\n  We assume input has dim (batch, width, r)\n  '
    with tf.compat.v1.name_scope('subpixel'):
        X = tf.transpose(a=I, perm=[2, 1, 0])
        X = tf.batch_to_space(X, [r], [[0, 0]])
        X = tf.transpose(a=X, perm=[2, 1, 0])
        return X
One-dimensional subpixel upsampling layer

Calls a tensorflow function that directly implements this functionality.
We assume input has dim (batch, width, r)
def SubPixel1D(I, r):
    'One-dimensional subpixel upsampling layer\n\n  Calls a tensorflow function that directly implements this functionality.\n  We assume input has dim (batch, width, r)\n  '
    with tf.compat.v1.name_scope('subpixel'):
        X = tf.transpose(a=I, perm=[2, 1, 0])
        X = tf.batch_to_space(X, [r], [[0, 0]])
        X = tf.transpose(a=X, perm=[2, 1, 0])
        return X