code: def check_forward(self, x_data, t_data):
      x = chainer.Variable(x_data)
      t = chainer.Variable(t_data, requires_grad=False)
  
      self.link.sample_data = self.link.sampler.sample(
          (self.batch_size, self.n_samples)
      )
      y = self.link(x, t)
  
      expect_y = numpy.empty((self.batch_size), dtype=self.dtype)
      samples = cuda.to_cpu(self.link.sample_data)
      for b in range(self.batch_size):
          z = 0
          for i in range(self.n_samples):
              w = samples[b, i]
              z += numpy.exp(self.w[w].dot(self.x[b]))
          y0 = self.w[self.t[b]].dot(self.x[b])
          z += numpy.exp(y0)
          l = y0 - numpy.log(z)
          for i in range(self.n_samples):
              w = samples[b, i]
              l += numpy.log(
                  1 - numpy.exp(self.w[w].dot(self.x[b])) / z
              )
  
          expect_y[b] = l
  
      loss = -numpy.sum(expect_y) / self.batch_size
      testing.assert_allclose(
          y.data, loss, **self.check_forward_options
      )
  
file_path: chainer/tests/chainer_tests/links_tests/loss_tests/test_black_out.py
imports: import unittest
  import numpy
  import chainer
  from chainer.backends import cuda
  from chainer import links
  from chainer import testing
  from chainer.testing import attr
label_desc: Use image node_id 3 for calling the TestBlackOut obj's underlying member method code with example usage: obj.check_forward(x_data, t_data) without return types