zoo/shufflenet/shufflenet_c.py
def channel_shuffle(self, x, n_partitions):
        ''' Implements the channel shuffle layer 
            x            : input tensor
            n_partitions : number of groups to partition feature maps (channels) into.
        '''

        # Get dimensions of the input tensor
        batch, height, width, n_filters = x.shape

        # Derive the number of input filters (channels) per group
        grp_in_filters  = n_filters // n_partitions

        # Separate out the channel groups
        x = Lambda(lambda z: K.reshape(z, [-1, height, width, n_partitions, grp_in_filters]))(x)
        # Transpose the order of the channel groups (i.e., 3, 4 => 4, 3)
        x = Lambda(lambda z: K.permute_dimensions(z, (0, 1, 2, 4, 3)))(x)
        # Restore shape
        x = Lambda(lambda z: K.reshape(z, [-1, height, width, n_filters]))(x)
        return x
 Implements the channel shuffle layer 
            x            : input tensor
            n_partitions : number of groups to partition feature maps (channels) into.
        
Implements the channel shuffle layer
x            : input tensor
n_partitions : number of groups to partition feature maps (channels) into.
Implements the channel shuffle layer x : input tensor n_partitions : number of groups to partition feature maps ( channels ) into .
def channel_shuffle(self, x, n_partitions):
        batch, height, width, n_filters = x.shape
        grp_in_filters  = n_filters // n_partitions
        x = Lambda(lambda z: K.reshape(z, [-1, height, width, n_partitions, grp_in_filters]))(x)
        x = Lambda(lambda z: K.permute_dimensions(z, (0, 1, 2, 4, 3)))(x)
        x = Lambda(lambda z: K.reshape(z, [-1, height, width, n_filters]))(x)
        return x
def channel_shuffle ( self , x , n_partitions ) : batch , height , width , n_filters = x . shape grp_in_filters = n_filters // n_partitions x = Lambda ( lambda z : K . reshape ( z , [ - 1 , height , width , n_partitions , grp_in_filters ] ) ) ( x ) x = Lambda ( lambda z : K . permute_dimensions ( z , ( 0 , 1 , 2 , 4 , 3 ) ) ) ( x ) x = Lambda ( lambda z : K . reshape ( z , [ - 1 , height , width , n_filters ] ) ) ( x ) return x
Implements the channel shuffle layer
x            : input tensor
n_partitions : number of groups to partition feature maps (channels) into.
Implements the channel shuffle layer x : input tensor n_partitions : number of groups to partition feature maps ( channels ) into .
''' Implements the channel shuffle layer 
            x            : input tensor
            n_partitions : number of groups to partition feature maps (channels) into.
        ''' # Get dimensions of the input tensor # Derive the number of input filters (channels) per group # Separate out the channel groups # Transpose the order of the channel groups (i.e., 3, 4 => 4, 3) # Restore shape
self
x
n_partitions