code: def test_rand_cpu(self):
      n_bins, n_samples, batch_size = 11, 17, 9
      weights = torch.rand(size=(batch_size, n_bins))
      bins = torch.cumsum(
          torch.rand(size=(batch_size, n_bins + 1)), dim=-1
      )
      torch.manual_seed(1)
      python = sample_pdf_python(bins, weights, n_samples)
      torch.manual_seed(1)
      cpp = sample_pdf(bins, weights, n_samples)
  
      self.assertClose(cpp, python, atol=2e-3)
  
file_path: pytorch3d/tests/test_sample_pdf.py
imports: import unittest
  from itertools import product
  import torch
  from pytorch3d.renderer.implicit.sample_pdf import sample_pdf, sample_pdf_python
  from .common_testing import TestCaseMixin
label_desc: Use image node_id 4 for calling the TestSamplePDF obj's underlying member method code with example usage: obj.test_rand_cpu() without return types