original_docstring: 
      Parameters
      ----------
      x: Input data 2D tensor
      w: Weight 2D tensor
      s_in: 1D tensor with scaling factors of the input activations
      Returns
      -------
      2D tensor with output activations
      Max activation in the layer
      1D tensor with output scaling factors
      
docstring: Parameters
  x: Input data 2D tensor
  w: Weight 2D tensor
  s_in: 1D tensor with scaling factors of the input activations
  Returns
  
  2D tensor with output activations
  Max activation in the layer
  1D tensor with output scaling factors
docstring_tokens: Parameters x : Input data 2D tensor w : Weight 2D tensor s_in : 1D tensor with scaling factors of the input activations Returns 2D tensor with output activations Max activation in the layer 1D tensor with output scaling factors
code: def sc_add(x, b, s_in, upscale=False):
      """
      Parameters
      ----------
      x: Input data 2D tensor
      w: Weight 2D tensor
      s_in: 1D tensor with scaling factors of the input activations
      Returns
      -------
      2D tensor with output activations
      Max activation in the layer
      1D tensor with output scaling factors
      """
  
      # Down-scale bias terms by s_in
      global obj_var
      if obj_var is None:
          obj_var = s_in
      b_scaled = tf.div(b, s_in, name="mydiv4")
  
      # Scaled addition using down-scaled bias terms
      y = tf.div(tf.add(x, b_scaled), 2, name="mydiv5")
  
      curr_scale = tf.multiply(s_in, 2)
  
      # Apply gain followed by saturation
      if (upscale):
          z_upscaled = tf.multiply(y, 2)
          out_scale = tf.div(curr_scale, 2, name="mydiv6")
      else:
          z_upscaled = y
          out_scale = curr_scale
  
      max_act = tf.reduce_max(z_upscaled)
  
      z_clipped = tf.clip_by_value(z_upscaled, -1, +1)
  
      return z_clipped, max_act, out_scale
code_tokens: def sc_add ( x , b , s_in , upscale = False ) : global obj_var if obj_var is None : obj_var = s_in b_scaled = tf . div ( b , s_in , name = "mydiv4" ) y = tf . div ( tf . add ( x , b_scaled ) , 2 , name = "mydiv5" ) curr_scale = tf . multiply ( s_in , 2 ) if ( upscale ) : z_upscaled = tf . multiply ( y , 2 ) out_scale = tf . div ( curr_scale , 2 , name = "mydiv6" ) else : z_upscaled = y out_scale = curr_scale max_act = tf . reduce_max ( z_upscaled ) z_clipped = tf . clip_by_value ( z_upscaled , - 1 , + 1 ) return z_clipped , max_act , out_scale
short_docstring: Parameters
  x: Input data 2D tensor
  w: Weight 2D tensor
  s_in: 1D tensor with scaling factors of the input activations
  Returns
short_docstring_tokens: Parameters x : Input data 2D tensor w : Weight 2D tensor s_in : 1D tensor with scaling factors of the input activations Returns
comment: """
      Parameters
      ----------
      x: Input data 2D tensor
      w: Weight 2D tensor
      s_in: 1D tensor with scaling factors of the input activations
      Returns
      -------
      2D tensor with output activations
      Max activation in the layer
      1D tensor with output scaling factors
      """$SEP$# Down-scale bias terms by s_in$SEP$# Scaled addition using down-scaled bias terms$SEP$# Apply gain followed by saturation