code: def gen_test_inputs(
      self, N, T, H, smoothing, padding_idx, dtype=torch.half
  ):
      logits = torch.randn(
          (N * T, H), dtype=dtype, device="cuda", requires_grad=True
      )
      labels = torch.randint(0, H, [N * T], device="cuda")
      for i in random.sample(range(N * T), N * T // 6):
          labels[i] = padding_idx
      half_to_float = logits.dtype == torch.half
  
      return logits, labels, half_to_float
  
file_path: apex/apex/contrib/test/xentropy/test_label_smoothing.py
imports: import unittest
  import random
  import time
  import numpy
  import torch
label_desc: Use image node_id 2 for calling the LabelSmoothingTest obj's underlying member method code with example usage: obj.gen_test_inputs(N, T, H, smoothing, padding_idx, dtype) and returns: logits,  labels,  half_to_float