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

Function channel_shuffle

examples/ImageNetModels/shufflenet.py:41–48  ·  view source on GitHub ↗
(l, group)

Source from the content-addressed store, hash-verified

39
40@under_name_scope()
41def channel_shuffle(l, group):
42 in_shape = l.get_shape().as_list()
43 in_channel = in_shape[1]
44 assert in_channel % group == 0, in_channel
45 l = tf.reshape(l, [-1, in_channel // group, group] + in_shape[-2:])
46 l = tf.transpose(l, [0, 2, 1, 3, 4])
47 l = tf.reshape(l, [-1, in_channel] + in_shape[-2:])
48 return l
49
50
51@layer_register()

Callers 2

shufflenet_unitFunction · 0.85
shufflenet_unit_v2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected