code: def sg_bce(tensor, opt):
      r
      
      assert opt.target is not None, 'target is mandatory.'
  
      out = tf.identity(tf.nn.sigmoid_cross_entropy_with_logits(labels=opt.target, logits=tensor), 'bce')
  
      # add summary
      tf.sg_summary_loss(out, name=opt.name)
  
      return out
docs: r"""Returns sigmoid cross entropy loss between `tensor` and `target`.
      
      Args:
        tensor: A `Tensor`. Logits. Unscaled log probabilities.
        opt:
          target: A `Tensor` with the same shape and dtype as `tensor`. Labels.
          name: A `string`. A name to display in the tensor board web UI.
        
      Returns:
        A `Tensor` of the same shape as `tensor`
      
      For example, 
      
      ```
      tensor = [[2, -1, 3], [3, 1, -2]]
      target = [[0, 1, 1], [1, 1, 0]]
      tensor.sg_bce(target=target) =>     [[ 2.12692809  1.31326163  0.04858733]
                                           [ 0.04858733  0.31326166  0.12692805]]
      ```