original_docstring: 
      creates a shuffleunit
  
      Parameters
      ----------
      inputs:
          Input tensor of with `channels_last` data format
      in_channels:
          number of input channels
      out_channels:
          number of output channels
      strides:
          An integer or tuple/list of 2 integers,
          specifying the strides of the convolution along the width and height.
      groups: int(1)
          number of groups per channel
      bottleneck_ratio: float
          bottleneck ratio implies the ratio of bottleneck channels to output channels.
          For example, bottleneck ratio = 1 : 4 means the output feature map is 4 times
          the width of the bottleneck feature map.
      stage: int(1)
          stage number
      block: int(1)
          block number
  
      Returns
      -------
  
      
docstring: creates a shuffleunit
  Parameters
  
  Input tensor of with `channels_last` data format
  in_channels:
  number of input channels
  out_channels:
  number of output channels
  strides:
  An integer or tuple/list of 2 integers,
  specifying the strides of the convolution along the width and height.
  groups: int(1)
  number of groups per channel
  bottleneck_ratio: float
  bottleneck ratio implies the ratio of bottleneck channels to output channels.
  For example, bottleneck ratio = 1 : 4 means the output feature map is 4 times
  the width of the bottleneck feature map.
  
  Returns
docstring_tokens: creates a shuffleunit Parameters Input tensor of with ` channels_last ` data format in_channels : number of input channels out_channels : number of output channels strides : An integer or tuple / list of 2 integers specifying the strides of the convolution along the width and height . groups : int ( 1 ) number of groups per channel bottleneck_ratio : float bottleneck ratio implies the ratio of bottleneck channels to output channels . For example bottleneck ratio = 1 : 4 means the output feature map is 4 times the width of the bottleneck feature map . Returns
code: def _shuffle_unit(inputs, in_channels, out_channels, groups, bottleneck_ratio, strides=2, stage=1, block=1):
      """
      creates a shuffleunit
  
      Parameters
      ----------
      inputs:
          Input tensor of with `channels_last` data format
      in_channels:
          number of input channels
      out_channels:
          number of output channels
      strides:
          An integer or tuple/list of 2 integers,
          specifying the strides of the convolution along the width and height.
      groups: int(1)
          number of groups per channel
      bottleneck_ratio: float
          bottleneck ratio implies the ratio of bottleneck channels to output channels.
          For example, bottleneck ratio = 1 : 4 means the output feature map is 4 times
          the width of the bottleneck feature map.
      stage: int(1)
          stage number
      block: int(1)
          block number
  
      Returns
      -------
  
      """
      if K.image_data_format() == 'channels_last':
          bn_axis = -1
      else:
          bn_axis = 1
  
      prefix = 'stage%d/block%d' % (stage, block)
  
      #if strides >= 2:
          #out_channels -= in_channels
  
      # default: 1/4 of the output channel of a ShuffleNet Unit
      bottleneck_channels = int(out_channels * bottleneck_ratio)
      groups = (1 if stage == 2 and block == 1 else groups)
  
      x = _group_conv(inputs, in_channels, out_channels=bottleneck_channels,
                      groups=(1 if stage == 2 and block == 1 else groups),
                      name='%s/1x1_gconv_1' % prefix)
      x = BatchNormalization(axis=bn_axis, name='%s/bn_gconv_1' % prefix)(x)
      x = Activation('relu', name='%s/relu_gconv_1' % prefix)(x)
  
      x = Lambda(channel_shuffle, arguments={'groups': groups}, name='%s/channel_shuffle' % prefix)(x)
      x = DepthwiseConv2D(kernel_size=(3, 3), padding="same", use_bias=False,
                          strides=strides, name='%s/1x1_dwconv_1' % prefix)(x)
      x = BatchNormalization(axis=bn_axis, name='%s/bn_dwconv_1' % prefix)(x)
  
      x = _group_conv(x, bottleneck_channels, out_channels=out_channels if strides == 1 else out_channels - in_channels,
                      groups=groups, name='%s/1x1_gconv_2' % prefix)
      x = BatchNormalization(axis=bn_axis, name='%s/bn_gconv_2' % prefix)(x)
  
      if strides < 2:
          ret = Add(name='%s/add' % prefix)([x, inputs])
      else:
          avg = AveragePooling2D(pool_size=3, strides=2, padding='same', name='%s/avg_pool' % prefix)(inputs)
          ret = Concatenate(bn_axis, name='%s/concat' % prefix)([x, avg])
  
      ret = Activation('relu', name='%s/relu_out' % prefix)(ret)
  
      return ret
code_tokens: def _shuffle_unit ( inputs , in_channels , out_channels , groups , bottleneck_ratio , strides = 2 , stage = 1 , block = 1 ) : if K . image_data_format ( ) == 'channels_last' : bn_axis = - 1 else : bn_axis = 1 prefix = 'stage%d/block%d' % ( stage , block ) bottleneck_channels = int ( out_channels * bottleneck_ratio ) groups = ( 1 if stage == 2 and block == 1 else groups ) x = _group_conv ( inputs , in_channels , out_channels = bottleneck_channels , groups = ( 1 if stage == 2 and block == 1 else groups ) , name = '%s/1x1_gconv_1' % prefix ) x = BatchNormalization ( axis = bn_axis , name = '%s/bn_gconv_1' % prefix ) ( x ) x = Activation ( 'relu' , name = '%s/relu_gconv_1' % prefix ) ( x ) x = Lambda ( channel_shuffle , arguments = { 'groups' : groups } , name = '%s/channel_shuffle' % prefix ) ( x ) x = DepthwiseConv2D ( kernel_size = ( 3 , 3 ) , padding = "same" , use_bias = False , strides = strides , name = '%s/1x1_dwconv_1' % prefix ) ( x ) x = BatchNormalization ( axis = bn_axis , name = '%s/bn_dwconv_1' % prefix ) ( x ) x = _group_conv ( x , bottleneck_channels , out_channels = out_channels if strides == 1 else out_channels - in_channels , groups = groups , name = '%s/1x1_gconv_2' % prefix ) x = BatchNormalization ( axis = bn_axis , name = '%s/bn_gconv_2' % prefix ) ( x ) if strides < 2 : ret = Add ( name = '%s/add' % prefix ) ( [ x , inputs ] ) else : avg = AveragePooling2D ( pool_size = 3 , strides = 2 , padding = 'same' , name = '%s/avg_pool' % prefix ) ( inputs ) ret = Concatenate ( bn_axis , name = '%s/concat' % prefix ) ( [ x , avg ] ) ret = Activation ( 'relu' , name = '%s/relu_out' % prefix ) ( ret ) return ret
short_docstring: creates a shuffleunit
  Parameters
short_docstring_tokens: creates a shuffleunit Parameters
comment: """
      creates a shuffleunit
  
      Parameters
      ----------
      inputs:
          Input tensor of with `channels_last` data format
      in_channels:
          number of input channels
      out_channels:
          number of output channels
      strides:
          An integer or tuple/list of 2 integers,
          specifying the strides of the convolution along the width and height.
      groups: int(1)
          number of groups per channel
      bottleneck_ratio: float
          bottleneck ratio implies the ratio of bottleneck channels to output channels.
          For example, bottleneck ratio = 1 : 4 means the output feature map is 4 times
          the width of the bottleneck feature map.
      stage: int(1)
          stage number
      block: int(1)
          block number
  
      Returns
      -------
  
      """$SEP$#if strides >= 2:$SEP$#out_channels -= in_channels$SEP$# default: 1/4 of the output channel of a ShuffleNet Unit