class_docstr: Test loss functions.
class_docstr_tok: ["Test","loss","functions","."]
docstr: Test SigmoidCrossEntropy.
code: def test_sigmoid_cross_entropy_pytorch(self):
      """Test SigmoidCrossEntropy."""
      loss = losses.SigmoidCrossEntropy()
      y = [[0.1, 0.8], [0.4, 0.6]]
      outputs = torch.tensor(y)
      labels = torch.tensor([[0.0, 1.0], [1.0, 0.0]])
      result = loss._create_pytorch_loss()(outputs, labels).numpy()
      sigmoid = 1.0 / (1.0 + np.exp(-np.array(y)))
      expected = [
          [-np.log(1 - sigmoid[0, 0]), -np.log(sigmoid[0, 1])],
          [-np.log(sigmoid[1, 0]), -np.log(1 - sigmoid[1, 1])],
      ]
      assert np.allclose(expected, result)
  
imports: import unittest
  import numpy
  import pytest
  import deepchem
  import deepchem.models.losses
label_desc: Use image node_id 18 for calling the TestLosses obj's underlying member method code with example usage: obj.test_sigmoid_cross_entropy_pytorch() without return types