code: def _view_sample_naive(
      pts,
      seq_id_pts,
      camera,
      seq_id_camera,
      feats,
      masks,
      masked_sampling,
  ):
      """
      A naive implementation of the forward pass of ViewSampler.
      Refer to ViewSampler's docstring for description of the arguments.
      """
  
      pts_batch = pts.shape[0]
      n_views = camera.R.shape[0]
      n_pts = pts.shape[1]
  
      feats_sampled = [
          [[] for _ in range(n_views)] for _ in range(pts_batch)
      ]
      masks_sampled = [
          [[] for _ in range(n_views)] for _ in range(pts_batch)
      ]
  
      for pts_i in range(pts_batch):
          for view_i in range(n_views):
              if seq_id_pts[pts_i] != seq_id_camera[view_i]:
                  # points/cameras come from different sequences
                  feats_sampled_ = {
                      k: f.new_zeros(n_pts, f.shape[1])
                      for k, f in feats.items()
                  }
                  masks_sampled_ = masks.new_zeros(n_pts, 1)
              else:
                  # same sequence of pts and cameras -> sample
                  (
                      feats_sampled_,
                      masks_sampled_,
                  ) = _sample_one_view_naive(
                      camera[view_i],
                      pts[pts_i],
                      {k: f[view_i] for k, f in feats.items()},
                      masks[view_i],
                      masked_sampling,
                      sampling_mode="bilinear",
                  )
              feats_sampled[pts_i][view_i] = feats_sampled_
              masks_sampled[pts_i][view_i] = masks_sampled_
  
      masks_sampled_cat = torch.stack(
          [torch.stack(m) for m in masks_sampled]
      )
      feats_sampled_cat = {}
      for k in feats_sampled[0][0].keys():
          feats_sampled_cat[k] = torch.stack(
              [torch.stack([f_[k] for f_ in f]) for f in feats_sampled]
          )
      return feats_sampled_cat, masks_sampled_cat
  
file_path: pytorch3d/tests/implicitron/test_viewsampling.py
imports: import unittest
  import pytorch3d
  import torch
  from pytorch3d.implicitron.models.view_pooler.view_sampler import ViewSampler
  from pytorch3d.implicitron.tools.config import expand_args_fields
label_desc: Use image node_id 1 for calling a global function with example usage: _view_sample_naive(pts, seq_id_pts, camera, seq_id_camera, feats, masks, masked_sampling) and returns: feats_sampled_cat,  masks_sampled_cat