class_docstr: Random sampler.
  
  Args:
      num (int): Number of samples
      pos_fraction (float): Fraction of positive samples
      neg_pos_up (int, optional): Upper bound number of negative and
          positive samples. Defaults to -1.
      add_gt_as_proposals (bool, optional): Whether to add ground truth
          boxes as proposals. Defaults to True.
docstr: Randomly sample some negative samples.
docstr_tok: ["Randomly","sample","some","negative","samples","."]
code: def _sample_neg(self, assign_result, num_expected, **kwargs):
      """Randomly sample some negative samples."""
      neg_inds = torch.nonzero(
          assign_result.gt_inds == 0, as_tuple=False
      )
      if neg_inds.numel() != 0:
          neg_inds = neg_inds.squeeze(1)
      if len(neg_inds) <= num_expected:
          return neg_inds
      else:
          return self.random_choice(neg_inds, num_expected)
  
file_path: insightface/detection/scrfd/mmdet/core/bbox/samplers/random_sampler.py
imports: import torch
  from ..builder import BBOX_SAMPLERS
  from .base_sampler import BaseSampler
label_desc: Use image node_id 4 for calling the RandomSampler obj's underlying member method code with example usage: obj._sample_neg(assign_result, num_expected) and returns: neg_inds, self