Skip to content

Commit 5d01ad1

Browse files
committed
[layers] subpixel act
1 parent fa5dc82 commit 5d01ad1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tensorlayer/layers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2086,6 +2086,10 @@ def SubpixelConv2d(net, scale=2, n_out_channel=None, act=tf.identity, name='subp
20862086

20872087
_err_log = "SubpixelConv2d: The number of input channels == (scale x scale) x The number of output channels"
20882088

2089+
scope_name = tf.get_variable_scope().name
2090+
if scope_name:
2091+
name = scope_name + '/' + name
2092+
20892093
def _phase_shift(I, r):
20902094
if tf.__version__ < '1.0':
20912095
raise Exception("Only support TF1.0+")
@@ -2121,7 +2125,7 @@ def _PS(X, r, n_out_channel):
21212125
assert int(inputs.get_shape()[-1])/ (scale ** 2) % 1 == 0, _err_log
21222126
n_out_channel = int(int(inputs.get_shape()[-1])/ (scale ** 2))
21232127

2124-
print(" [TL] SubpixelConv2d %s: scale: %d n_out_channel: %s" % (name, scale, n_out_channel))
2128+
print(" [TL] SubpixelConv2d %s: scale: %d n_out_channel: %s act: %s" % (name, scale, n_out_channel, act.__name__))
21252129

21262130
net_new = Layer(inputs, name=name)
21272131
net_new.outputs = act(_PS(inputs, r=scale, n_out_channel=n_out_channel))

0 commit comments

Comments
 (0)