(l, group)
| 39 | |
| 40 | @under_name_scope() |
| 41 | def 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() |
no outgoing calls
no test coverage detected