class_docstr: Contrastive Model, currently mainly focused on memory bank and CSC.
class_docstr_tok: ["Contrastive","Model",",","currently","mainly","focused","on","memory","bank","and","CSC","."]
code: def _dequeue_and_enqueue(self, keys, extra_keys=None):
      ptr = int(self.ptr.item())
      if (
          not self.cfg.CONTRASTIVE.MOCO_MULTI_VIEW_QUEUE
      ):  # TODO: add multiview negatives
          keys_queue_update = [keys[0]]
      else:
          assert (
              len(keys) > 0
          ), "need to have multiple views for adding them to queue"
          keys_queue_update = []
          keys_queue_update += keys
          if extra_keys:
              keys_queue_update += [
                  item for sublist in extra_keys for item in sublist
              ]
      for key in keys_queue_update:
          # write the current feat into queue, at pointer
          num_items = int(key.size(0))
  
          assert self.k % num_items == 0
          assert ptr + num_items <= self.k
          self.queue_x[ptr : ptr + num_items, :] = key
          # move pointer
          ptr += num_items
          # reset pointer
          if ptr == self.k:
              ptr = 0
          self.ptr[0] = ptr
  
imports: import math
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import slowfast.models.losses
  import slowfast.utils.distributed
  import slowfast.utils.logging
  from slowfast.models.video_model_builder import X3D, MViT, ResNet, SlowFast
  from .build import MODEL_REGISTRY
label_desc: Use image node_id 10 for calling the ContrastiveModel obj's underlying member method code with example usage: obj._dequeue_and_enqueue(keys, extra_keys) without return types