code: def not_self_comparisons(
      a, p, s, e, curr_batch_idx, ref_size, ref_is_subset=False
  ):
      if ref_is_subset:
          a, p = p, a
      curr_batch = torch.any(p.unsqueeze(1) == curr_batch_idx, dim=1)
      a_c = a[curr_batch]
      p_c = p[curr_batch]
      p_c -= s
      if e <= s:
          p_c[p_c <= e - s] += ref_size
      without_self_comparisons = curr_batch.clone()
      without_self_comparisons[
          torch.where(curr_batch)[0][a_c == p_c]
      ] = False
      return without_self_comparisons | ~curr_batch
  
imports: import math
  import numpy
  import torch
  from .None import common_functions
label_desc: Use image node_id 16 for calling a global function with example usage: not_self_comparisons(a, p, s, e, curr_batch_idx, ref_size, ref_is_subset) and returns: unknown