class_docstr: Test label smoothing.
docstr: Test if output is correct for the sLCWA training loop use case.
docstr_tok: ["Test","if","output","is","correct","for","the","sLCWA","training","loop","use","case","."]
code: def test_slcwa_label_smoothing(self):
      """Test if output is correct for the sLCWA training loop use case."""
      # Create dummy sLCWA labels
      ones = torch.ones(self.batch_size, 1)
      zeros = torch.zeros(self.batch_size, 1)
      labels = torch.cat([ones, zeros], dim=0)
  
      # Apply label smoothing
      smooth_labels = apply_label_smoothing(
          labels=labels,
          epsilon=self.epsilon,
          num_classes=self.num_entities,
      )
      exp_true = 1.0 - self.epsilon
      np.testing.assert_allclose(
          smooth_labels[: self.batch_size],
          exp_true,
          rtol=self.relative_tolerance,
      )
      exp_false = self.epsilon / (self.num_entities - 1.0)
      np.testing.assert_allclose(
          smooth_labels[self.batch_size :],
          exp_false,
          rtol=self.relative_tolerance,
      )
  
imports: import unittest
  import numpy
  import torch
  import unittest_templates
  import pykeen.losses
  from pykeen.losses import Loss, NSSALoss, apply_label_smoothing
  from pykeen.pipeline import PipelineResult, pipeline
  from tests import cases
label_desc: Use image node_id 3 for calling the LabelSmoothingTest obj's underlying member method code with example usage: obj.test_slcwa_label_smoothing() without return types