docs: def sg_ce(tensor, opt):
      r"""Returns softmax cross entropy loss between `tensor` and `target`.
      
      Args:
        tensor: A `Tensor`. Logits. Unscaled log probabilities.
        opt:
          target: A `Tensor` with the same length in the first dimension as the `tensor`. Labels. 
          one_hot: Boolean. Whether to treat the labels as one-hot encoding. Default is False.
          mask: Boolean. If True, zeros in the target will be excluded from the calculation.
          name: A `string`. A name to display in the tensor board web UI.
        
      Returns:
        A 1-D `Tensor` with the same shape as `tensor`. 
      
      For example, 
      
      ```
      tensor = [[[2, -1, 3], [3, 1, -2]]]
      target = [[2, 1]]
      tensor.sg_ce(target=target) => [[ 0.32656264  2.13284516]]
      ```
      
      For example,
      
      ```
      tensor = [[2, -1, 3], [3, 1, -2]]
      target = [[0, 0, 1], [1, 0, 0]]
      tensor.sg_ce(target=target, one_hot=True) => [ 0.32656264  0.13284527]
      ```
      """
      opt += tf.sg_opt(one_hot=False)
      assert opt.target is not None, 'target is mandatory.'
  
      if opt.one_hot:
          out = tf.identity(tf.nn.softmax_cross_entropy_with_logits(labels=opt.target, logits=tensor), 'ce')
      else:
          out = tf.identity(tf.nn.sparse_softmax_cross_entropy_with_logits(labels=opt.target, logits=tensor), 'ce')
  
      # masking loss
      if opt.mask:
          out *= tf.not_equal(opt.target, tf.zeros_like(opt.target)).sg_float()
  
      # add summary
      tf.sg_summary_loss(out, name=opt.name)
  
      return out