facebookresearch / moco

PyTorch implementation of MoCo: https://arxiv.org/abs/1911.05722
MIT License
4.82k stars 794 forks source link

Question about queue dimension #143

Open yeomjh00 opened 1 year ago

yeomjh00 commented 1 year ago

https://github.com/facebookresearch/moco/blob/5a429c00bb6d4efdf511bf31b6f01e064bf929ab/moco/builder.py#L50

Hello. I have a simple question about queue dimension in moco/builder.py

I noticed that K is a length of queue, and dim is a feature dimension.

Isn't it faster accessing each feature with row major than accessing with column major?

Can anybody explain me why queue designed with dim [dim(feature), queue_length]?