Skip to content

Instantly share code, notes, and snippets.

@thunderInfy
Created August 6, 2020 22:15
Show Gist options
  • Select an option

  • Save thunderInfy/ff43679bd91decd939d4ab5233479906 to your computer and use it in GitHub Desktop.

Select an option

Save thunderInfy/ff43679bd91decd939d4ab5233479906 to your computer and use it in GitHub Desktop.
# update the queue
queue = torch.cat((queue, k), 0)
# dequeue if the queue gets larger than the max queue size - denoted by K
# batch size is 256, can be replaced by a variable
if queue.shape[0] > K:
queue = queue[256:,:]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment