MCPcopy Create free account
hub / github.com/CompVis/diff2flow / extract_into_tensor

Function extract_into_tensor

diff2flow/utils/diffusion_utils.py:56–59  ·  view source on GitHub ↗
(a, t, x_shape)

Source from the content-addressed store, hash-verified

54
55
56def extract_into_tensor(a, t, x_shape):
57 b, *_ = t.shape
58 out = a.gather(-1, t)
59 return out.reshape(b, *((1,) * (len(x_shape) - 1)))
60
61def extract_and_interpolate_into_tensor(a, t, x_shape):
62 b, *_ = t.shape

Callers 3

Calls

no outgoing calls

Tested by

no test coverage detected