class_docstr: Test loss functions.
class_docstr_tok: ["Test","loss","functions","."]
docstr: Test SquaredHingeLoss.
code: def test_squared_hinge_loss_pytorch(self):
      """Test SquaredHingeLoss."""
      loss = losses.SquaredHingeLoss()
      outputs = torch.tensor([[0.1, 0.8], [0.4, 0.6]])
      labels = torch.tensor([[1.0, -1.0], [-1.0, 1.0]])
      result = loss._create_pytorch_loss()(outputs, labels).numpy()
      expected = [np.mean([0.8100, 3.2400]), np.mean([1.9600, 0.1600])]
      assert np.allclose(expected, result)
  
imports: import unittest
  import numpy
  import pytest
  import deepchem
  import deepchem.models.losses
label_desc: Use image node_id 10 for calling the TestLosses obj's underlying member method code with example usage: obj.test_squared_hinge_loss_pytorch() without return types