code: def test_smooth_mask_adds_to_one(K, alpha):
      bin_log_probs = mx.nd.log_softmax(mx.nd.ones(K))
      bin_centers = mx.nd.arange(K)
  
      dist = Binned(
          bin_log_probs=bin_log_probs,
          bin_centers=bin_centers,
          label_smoothing=0.2,
      )
  
      labels = mx.random.uniform(
          low=0, high=K, shape=(12,)
      ).expand_dims(-1)
      mask = dist._get_mask(labels)
      smooth_mask = dist._smooth_mask(
          mx.nd, mask, alpha=mx.nd.array([alpha])
      )
  
      # check smooth mask adds to one
      assert np.allclose(
          smooth_mask.asnumpy().sum(axis=-1), np.ones(12), atol=1e-6
      )
  
file_path: gluonts/test/mx/distribution/test_label_smoothing.py
imports: import itertools
  import mxnet
  import numpy
  import pytest
  from gluonts.mx.distribution import Binned, BinnedOutput
label_desc: Use image node_id 2 for calling a global function with example usage: test_smooth_mask_adds_to_one(K, alpha) without return types