MCPcopy Create free account
hub / github.com/TPCD/DCCL / cm

Function cm

project_utils/cluster_memory_utils.py:35–39  ·  view source on GitHub ↗
(inputs, indexes, features, momentum=0.5, device=None)

Source from the content-addressed store, hash-verified

33
34
35def cm(inputs, indexes, features, momentum=0.5, device=None):
36 if device is None:
37 return CM.apply(inputs, indexes, features.to(inputs.device), torch.Tensor([momentum]).to(inputs.device))
38 else:
39 return CM.apply(inputs.to(device), indexes, features.to(device), torch.Tensor([momentum]).to(device))
40
41
42class CM_Hard(autograd.Function):

Callers 1

forwardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected