MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / __call__

Method __call__

sat/sgm/util.py:375–383  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

373 self.cnt = 0
374
375 def __call__(self, x):
376 self.cnt += 1
377 randn_combined = torch.zeros_like(x)
378 for seed, weight in zip(self.seeds, self.weights):
379 randn = np.random.RandomState(seed + self.cnt).randn(*x.shape)
380 randn = torch.from_numpy(randn, dtype=x.dtype, device=x.device)
381 randn_combined += randn * weight
382 randn_combined /= self.weight_square_sum_sqrt
383 return randn_combined

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected