MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / batched_index_select

Function batched_index_select

utils/general_util.py:19–22  ·  view source on GitHub ↗
(t, dim, inds)

Source from the content-addressed store, hash-verified

17 return output_start + ((output_end - output_start) / (input_end - input_start)) * (input_clamped - input_start)
18
19def batched_index_select(t, dim, inds):
20 dummy = inds.unsqueeze(2).expand(inds.size(0), inds.size(1), t.size(2))
21 out = t.gather(dim, dummy) # b x e x f
22 return out
23
24def tridiagonal_solve(b, A_upper, A_diagonal, A_lower):
25 """Solves a tridiagonal system Ax = b.

Callers 1

forwardMethod · 0.90

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected