MCPcopy
hub / github.com/ali-vilab/AnyDoor / extract_into_tensor

Function extract_into_tensor

ldm/modules/diffusionmodules/util.py:96–99  ·  view source on GitHub ↗
(a, t, x_shape)

Source from the content-addressed store, hash-verified

94
95
96def extract_into_tensor(a, t, x_shape):
97 b, *_ = t.shape
98 out = a.gather(-1, t)
99 return out.reshape(b, *((1,) * (len(x_shape) - 1)))
100
101
102def checkpoint(func, inputs, params, flag):

Callers 11

q_sampleMethod · 0.90
stochastic_encodeMethod · 0.90
q_mean_varianceMethod · 0.90
q_posteriorMethod · 0.90
q_sampleMethod · 0.90
get_vMethod · 0.90
stochastic_encodeMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected