class_docstr: Test loss functions.
class_docstr_tok: ["Test","loss","functions","."]
docstr: Test L2Loss.
code: def test_l2_loss_tf(self):
      """Test L2Loss."""
      loss = losses.L2Loss()
      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 = [[0.1**2, 0.2**2], [0.6**2, 0.6**2]]
      assert np.allclose(expected, result)
  
imports: import unittest
  import numpy
  import pytest
  import deepchem
  import deepchem.models.losses
label_desc: Use image node_id 5 for calling the TestLosses obj's underlying member method code with example usage: obj.test_l2_loss_tf() without return types