code: def test_return_samples(self, backend_config):
      batch_size = self.t.shape[0]
      link = self.create_link()
      link.to_device(backend_config.device)
  
      x_data = backend_config.get_array(self.x)
      t_data = backend_config.get_array(self.t)
      x = chainer.Variable(x_data)
      t = chainer.Variable(t_data, requires_grad=False)
  
      # return_samples=True
      y, samples = link(x, t, reduce=self.reduce, return_samples=True)
  
      assert isinstance(samples, backend_config.xp.ndarray)
      assert samples.shape == (batch_size, self.sample_size + 1)
      assert samples.dtype == numpy.int32
  
      # return_samples=False, with saved samples
      y_ = self.call_link_with_samples(
          samples, lambda: link(x, t, reduce=self.reduce)
      )
  
      # y and y_ should equal
      cpu_device = CpuDevice()
      numpy.testing.assert_array_equal(
          cpu_device.send(y.array), cpu_device.send(y_.array)
      )
  
file_path: chainer/tests/chainer_tests/links_tests/loss_tests/test_negative_sampling.py
imports: import unittest
  import numpy
  import chainer
  from chainer import backend
  from chainer.backend import CpuDevice
  from chainer import links
  from chainer import testing
label_desc: Use image node_id 7 for calling the TestNegativeSampling obj's underlying member method code with example usage: obj.test_return_samples(backend_config) without return types