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

Function extract_into_tensor

sat/sgm/modules/diffusionmodules/util.py:31–34  ·  view source on GitHub ↗
(a, t, x_shape)

Source from the content-addressed store, hash-verified

29
30
31def extract_into_tensor(a, t, x_shape):
32 b, *_ = t.shape
33 out = a.gather(-1, t)
34 return out.reshape(b, *((1,) * (len(x_shape) - 1)))
35
36
37def mixed_checkpoint(func, inputs: dict, params, flag):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected