MCPcopy Create free account
hub / github.com/MotrixLab/insactor / _WrappedModel

Class _WrappedModel

diffplanner/models/utils/gaussian_diffusion.py:1284–1293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1282
1283
1284class _WrappedModel:
1285 def __init__(self, model, timestep_map, original_num_steps):
1286 self.model = model
1287 self.timestep_map = timestep_map
1288 self.original_num_steps = original_num_steps
1289
1290 def __call__(self, x, ts, **kwargs):
1291 map_tensor = th.tensor(self.timestep_map, device=ts.device, dtype=ts.dtype)
1292 new_ts = map_tensor[ts]
1293 return self.model(x, new_ts, **kwargs)

Callers 1

_wrap_modelMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected