MCPcopy Create free account
hub / github.com/FreeformRobotics/OTS / __init__

Method __init__

lib/utils/data/sampler.py:84–87  ·  view source on GitHub ↗
(self, weights, num_samples, replacement=True)

Source from the content-addressed store, hash-verified

82 """
83
84 def __init__(self, weights, num_samples, replacement=True):
85 self.weights = torch.DoubleTensor(weights)
86 self.num_samples = num_samples
87 self.replacement = replacement
88
89 def __iter__(self):
90 return iter(torch.multinomial(self.weights, self.num_samples, self.replacement))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected