Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion torchbenchmark/models/moco/moco/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _momentum_update_key_encoder(self):
Momentum update of the key encoder
"""
for param_q, param_k in zip(self.encoder_q.parameters(), self.encoder_k.parameters()):
param_k.data = param_k.data * self.m + param_q.data * (1. - self.m)
param_k.mul_(self.m).add_(param_q.mul(1. - self.m))

@torch.no_grad()
def _dequeue_and_enqueue(self, keys):
Expand Down