docs: def sg_upconv1d(tensor, opt):
      r"""Applies 1-D a up convolution (or convolution transpose).
  
      Args:
        tensor: A 3-D `Tensor` (automatically passed by decorator).
        opt:
          size:  A positive `integer` representing `[kernel width]`. As a default it is set to 4
          stride: A positive `integer` representing stride dimension. As a default it is set to 2
          in_dim: A positive `integer`. The size of input dimension.
          dim: A positive `integer`. The size of output dimension.
          pad: Either `SAME` (Default) or `VALID`.
          bias: Boolean. If True, biases are added.
          regularizer:  A (Tensor -> Tensor or None) function; the result of applying it on a newly created variable
            will be added to the collection tf.GraphKeys.REGULARIZATION_LOSSES and can be used for regularization
          summary: If True, summaries are added. The default is True.
  
      Returns:
        A `Tensor` with the same type as `tensor`.
      """
      # default options
      opt += tf.sg_opt(size=4, stride=2, pad='SAME')
      opt.size = [opt.size, 1]
      opt.stride = [1, opt.stride, 1, 1]
  
      # parameter tf.sg_initializer
      w = tf.sg_initializer.he_uniform('W', (opt.size[0], opt.size[1], opt.dim, opt.in_dim),
                                       regularizer=opt.regularizer, summary=opt.summary)
      b = tf.sg_initializer.constant('b', opt.dim, summary=opt.summary) if opt.bias else 0
  
      # make 4-D tensor
      tensor = tensor.sg_expand_dims(axis=2)
  
      # tedious shape handling for conv2d_transpose
      shape = tensor.get_shape().as_list()
      if opt.pad == "SAME":
          out_shape = [tf.shape(tensor)[0], shape[1] * opt.stride[1], shape[2] * opt.stride[2], opt.dim]
      else:
          out_shape = [tf.shape(tensor)[0], (shape[1] - 1) * opt.stride[1] + opt.size[0],
                       (shape[2] - 1) * opt.stride[2] + opt.size[1], opt.dim]
  
      # apply convolution
      out = tf.nn.conv2d_transpose(tensor, w, output_shape=tf.stack(out_shape),
                                   strides=opt.stride, padding=opt.pad) + b
      # reset shape is needed because conv2d_transpose() erase all shape information.
      # noinspection PyUnresolvedReferences
      out.set_shape([None, out_shape[1], out_shape[2], opt.dim])
  
      # squeeze
      out = out.sq_squeeze(axis=2)
  
      return out