MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / UnPooling2x2ZeroFilled

Function UnPooling2x2ZeroFilled

tensorpack/models/pool.py:73–85  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

71
72
73def UnPooling2x2ZeroFilled(x):
74 # https://github.com/tensorflow/tensorflow/issues/2169
75 out = tf.concat([x, tf.zeros_like(x)], 3)
76 out = tf.concat([out, tf.zeros_like(out)], 2)
77
78 sh = x.get_shape().as_list()
79 if None not in sh[1:]:
80 out_size = [-1, sh[1] * 2, sh[2] * 2, sh[3]]
81 return tf.reshape(out, out_size)
82 else:
83 shv = tf.shape(x)
84 ret = tf.reshape(out, tf.stack([-1, shv[1] * 2, shv[2] * 2, sh[3]]))
85 return ret
86
87
88@layer_register(log_shape=True)

Callers 1

FixedUnPoolingFunction · 0.85

Calls 1

shapeMethod · 0.80

Tested by

no test coverage detected