code: def binary_cross_entropy_loss_with_logits(x, target, name=None):
    
    with tf.name_scope(name, 'binary_cross_entropy_with_logits',
                       [x, target]) as scope:
      x.get_shape().assert_is_compatible_with(target.get_shape())
      neg_softplus = -tf.nn.softplus(-x)
      return -tf.add(tf.multiply(target, neg_softplus),
                     tf.multiply(1 - target, -x + neg_softplus),
                     name=scope)
docs: Calculates the binary cross entropy between sigmoid(x) and target.
  
    Expects unscaled logits. Do not pass in results of sigmoid operation.
  
    Args:
      x: the calculated pre-sigmoid values
      target: the desired values.
      name: the name for this op, defaults to binary_cross_entropy_with_logits
    Returns:
      -(target * -softplus(-x) + (1-target) * (-x - softplus(-x)))
    Raises:
      ValueError: If shapes are incompatible.