Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
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
496
def
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
502
def
mean_flat(tensor):
Callers
8
q_mean_variance
Method · 0.70
q_sample
Method · 0.70
get_v
Method · 0.70
predict_start_from_noise
Method · 0.70
predict_start_from_z_and_v
Method · 0.70
predict_eps_from_z_and_v
Method · 0.70
predict_eps_from_xstart
Method · 0.70
q_posterior
Method · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected