code: def check_sample(self, is_gpu):
      if is_gpu:
          smp1 = self.gpu_dist.sample(
              sample_shape=(100000,) + self.sample_shape
          ).data
      else:
          smp1 = self.cpu_dist.sample(
              sample_shape=(100000,) + self.sample_shape
          ).data
  
      smp2 = []
      for one_params in self.scipy_onebyone_params_iter():
          smp2.append(
              self.scipy_dist.rvs(
                  size=(100000,) + self.sample_shape, **one_params
              )
          )
      smp2 = numpy.vstack(smp2)
      smp2 = smp2.dot(numpy.arange(3))
      smp2 = smp2.reshape(
          (numpy.prod(self.shape), 100000)
          + self.sample_shape
          + self.cpu_dist.event_shape
      )
      smp2 = numpy.rollaxis(
          smp2, 0, smp2.ndim - len(self.cpu_dist.event_shape)
      )
      smp2 = smp2.reshape(
          (100000,)
          + self.sample_shape
          + self.shape
          + self.cpu_dist.event_shape
      )
      array.assert_allclose(
          smp1.mean(axis=0), smp2.mean(axis=0), atol=3e-2, rtol=3e-2
      )
      array.assert_allclose(
          smp1.std(axis=0), smp2.std(axis=0), atol=3e-2, rtol=3e-2
      )
  
file_path: chainer/tests/chainer_tests/distributions_tests/test_categorical.py
imports: import numpy
  from chainer import cuda
  from chainer import distributions
  from chainer import testing
  from chainer.testing import array
label_desc: Use image node_id 5 for calling the TestCategorical obj's underlying member method code with example usage: obj.check_sample(is_gpu) without return types