Function
cm
(inputs, indexes, features, momentum=0.5, device=None)
Source from the content-addressed store, hash-verified
| 33 | |
| 34 | |
| 35 | def 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 | |
| 42 | class CM_Hard(autograd.Function): |
Tested by
no test coverage detected