MCPcopy Index your code
hub / github.com/CompVis/diff2flow / extract_into_tensor

Function extract_into_tensor

diff2flow/ddpm.py:496–499  ·  view source on GitHub ↗
(a, t, x_shape)

Source from the content-addressed store, hash-verified

494
495
496def extract_into_tensor(a, t, x_shape):
497 b, *_ = t.shape
498 out = a.gather(-1, t)
499 return out.reshape(b, *((1,) * (len(x_shape) - 1)))
500
501
502def mean_flat(tensor):

Callers 8

q_mean_varianceMethod · 0.70
q_sampleMethod · 0.70
get_vMethod · 0.70
q_posteriorMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected