MCPcopy Create free account
hub / github.com/apple/ml-4m / replace_batch_random

Method replace_batch_random

fourm/vq/quantizers/quantize_lucid.py:360–362  ·  view source on GitHub ↗
(self, samples, mask)

Source from the content-addressed store, hash-verified

358 self.initted.data.copy_(torch.Tensor([True]))
359
360 def replace_batch_random(self, samples, mask):
361 samples = l2norm(samples)
362 self.embed.data[mask] = self.sample_fn(samples, mask.sum().item())
363
364 def replace_linde_buzo_gray(self, mask):
365 num_unused = mask.sum()

Callers 1

expire_codes_Method · 0.95

Calls 1

l2normFunction · 0.85

Tested by

no test coverage detected