human
I wrote the below code

    def _PS(I, r):
        X = tf.transpose(I, [2, 1, 0])
        X = tf.batch_to_space_nd(X, [r], [[0, 0]])
        X = tf.transpose(X, [2, 1, 0])
        return X
    print ('        [TL]    SubpixelConv1d        %s:    scale:    %d    act:    %s' % (name, scale, act.__name__))
    inputs = net.outputs
    net_new = Layer(inputs, name=name)
    with tf.name_scope(name):
        net_new.outputs = act(_PS(inputs, r=scale))
    net_new.all_layers = list(net.all_layers)
    net_new.all_params = list(net.all_params)
    net_new.all_drop = dict(net.all_drop)
    net_new.all_layers.extend([net_new.outputs])
    return net_new

What's a good function header?
assistant
#Here is Python program to print ('        [TL]    SubpixelConv1d        %s:    scale:    %d    act:    %s' % (name, scale, act.

def SubpixelConv1d(net, scale=2, act=tf.identity, name='subpixel_conv1d'):