parameters: (data, growth_rate, stride, name, bottle_neck=True, drop_out=0.0, bn_mom=0.9, workspace=512)
docstring: Return BaiscBlock Unit symbol for building DenseBlock
      Parameters
      ----------
      data : str
          Input data
      growth_rate : int
          Number of output channels
      stride : tupe
          Stride used in convolution
      drop_out : float
          Probability of an element to be zeroed. Default = 0.2
      name : str
          Base name of the operators
      workspace : int
          Workspace used in convolution operator
docstring_summary: Return BaiscBlock Unit symbol for building DenseBlock
      Parameters
      ----------
      data : str
          Input data
      growth_rate : int
          Number of output channels
      stride : tupe
          Stride used in convolution
      drop_out : float
          Probability of an element to be zeroed. Default = 0.2
      name : str
          Base name of the operators
      workspace : int
          Workspace used in convolution operator
docstring_tokens: Return BaiscBlock Unit symbol for building DenseBlock Parameters ---------- data : str Input data growth_rate : int Number of output channels stride : tupe Stride used in convolution drop_out : float Probability of an element to be zeroed . Default = 0 . 2 name : str Base name of the operators workspace : int Workspace used in convolution operator
function: def BasicBlock(data, growth_rate, stride, name, bottle_neck=True, drop_out=0.0, bn_mom=0.9, workspace=512):
      """Return BaiscBlock Unit symbol for building DenseBlock
      Parameters
      ----------
      data : str
          Input data
      growth_rate : int
          Number of output channels
      stride : tupe
          Stride used in convolution
      drop_out : float
          Probability of an element to be zeroed. Default = 0.2
      name : str
          Base name of the operators
      workspace : int
          Workspace used in convolution operator
      """
      # import pdb
      # pdb.set_trace()
  
      if bottle_neck:
          # the same as https://github.com/facebook/fb.resnet.torch#notes, a bit difference with origin paper
          bn1 = mx.sym.BatchNorm(data=data, fix_gamma=False, eps=2e-5, momentum=bn_mom, name=name + '_bn1')
          act1 = mx.sym.QActivation(data=bn1, backward_only=True, name=name + '_relu1', act_bit=BITA)
          conv1 = mx.sym.QConvolution(data=act1, num_filter=int(growth_rate * 4), kernel=(1, 1), stride=(1, 1), pad=(0, 0),
                                     no_bias=1, workspace=workspace, name=name + '_conv1', weight_bit=BITW, act_bit=BITA)
          if drop_out > 0:
              conv1 = mx.symbol.Dropout(data=conv1, p=drop_out, name=name + '_dp1')
          bn2 = mx.sym.BatchNorm(data=conv1, fix_gamma=False, eps=2e-5, momentum=bn_mom, name=name + '_bn2')
          act2 = mx.sym.QActivation(data=bn2, backward_only=True, name=name + '_relu2', act_bit=BITA)
          conv2 = mx.sym.QConvolution(data=act2, num_filter=int(growth_rate), kernel=(3, 3), stride=stride, pad=(1, 1),
                                     no_bias=1, workspace=workspace, name=name + '_conv2', weight_bit=BITW, act_bit=BITA)
          if drop_out > 0:
              conv2 = mx.symbol.Dropout(data=conv2, p=drop_out, name=name + '_dp2')
          # return mx.symbol.Concat(data, conv2, name=name + '_concat0')
          return conv2
      else:
          bn1 = mx.sym.BatchNorm(data=data, fix_gamma=False, eps=2e-5, momentum=bn_mom, name=name + '_bn1')
          act1 = mx.sym.QActivation(data=bn1, backward_only=True, name=name + '_relu1', act_bit=BITA)
          conv1 = mx.sym.QConvolution(data=act1, num_filter=int(growth_rate), kernel=(3, 3), stride=(1, 1), pad=(1, 1),
                                     no_bias=1, workspace=workspace, name=name + '_conv1', weight_bit=BITW, act_bit=BITA)
          if drop_out > 0:
              conv1 = mx.symbol.Dropout(data=conv1, p=drop_out, name=name + '_dp1')
          # return mx.symbol.Concat(data, conv1, name=name + '_concat0')
          return conv1
function_tokens: def BasicBlock ( data , growth_rate , stride , name , bottle_neck = True , drop_out = 0.0 , bn_mom = 0.9 , workspace = 512 ) : # import pdb # pdb.set_trace() if bottle_neck : # the same as https://github.com/facebook/fb.resnet.torch#notes, a bit difference with origin paper bn1 = mx . sym . BatchNorm ( data = data , fix_gamma = False , eps = 2e-5 , momentum = bn_mom , name = name + '_bn1' ) act1 = mx . sym . QActivation ( data = bn1 , backward_only = True , name = name + '_relu1' , act_bit = BITA ) conv1 = mx . sym . QConvolution ( data = act1 , num_filter = int ( growth_rate * 4 ) , kernel = ( 1 , 1 ) , stride = ( 1 , 1 ) , pad = ( 0 , 0 ) , no_bias = 1 , workspace = workspace , name = name + '_conv1' , weight_bit = BITW , act_bit = BITA ) if drop_out > 0 : conv1 = mx . symbol . Dropout ( data = conv1 , p = drop_out , name = name + '_dp1' ) bn2 = mx . sym . BatchNorm ( data = conv1 , fix_gamma = False , eps = 2e-5 , momentum = bn_mom , name = name + '_bn2' ) act2 = mx . sym . QActivation ( data = bn2 , backward_only = True , name = name + '_relu2' , act_bit = BITA ) conv2 = mx . sym . QConvolution ( data = act2 , num_filter = int ( growth_rate ) , kernel = ( 3 , 3 ) , stride = stride , pad = ( 1 , 1 ) , no_bias = 1 , workspace = workspace , name = name + '_conv2' , weight_bit = BITW , act_bit = BITA ) if drop_out > 0 : conv2 = mx . symbol . Dropout ( data = conv2 , p = drop_out , name = name + '_dp2' ) # return mx.symbol.Concat(data, conv2, name=name + '_concat0') return conv2 else : bn1 = mx . sym . BatchNorm ( data = data , fix_gamma = False , eps = 2e-5 , momentum = bn_mom , name = name + '_bn1' ) act1 = mx . sym . QActivation ( data = bn1 , backward_only = True , name = name + '_relu1' , act_bit = BITA ) conv1 = mx . sym . QConvolution ( data = act1 , num_filter = int ( growth_rate ) , kernel = ( 3 , 3 ) , stride = ( 1 , 1 ) , pad = ( 1 , 1 ) , no_bias = 1 , workspace = workspace , name = name + '_conv1' , weight_bit = BITW , act_bit = BITA ) if drop_out > 0 : conv1 = mx . symbol . Dropout ( data = conv1 , p = drop_out , name = name + '_dp1' ) # return mx.symbol.Concat(data, conv1, name=name + '_concat0') return conv1