class_docstr: Test loss functions.
class_docstr_tok: ["Test","loss","functions","."]
docstr: Test BinaryCrossEntropy.
code: def test_binary_cross_entropy_tf(self):
      """Test BinaryCrossEntropy."""
      loss = losses.BinaryCrossEntropy()
      outputs = tf.constant([[0.1, 0.8], [0.4, 0.6]])
      labels = tf.constant([[0.0, 1.0], [1.0, 0.0]])
      result = loss._compute_tf_loss(outputs, labels).numpy()
      expected = [
          -np.mean([np.log(0.9), np.log(0.8)]),
          -np.mean([np.log(0.4), np.log(0.4)]),
      ]
      assert np.allclose(expected, result)
  
imports: import unittest
  import numpy
  import pytest
  import deepchem
  import deepchem.models.losses
label_desc: Use image node_id 13 for calling the TestLosses obj's underlying member method code with example usage: obj.test_binary_cross_entropy_tf() without return types