MCPcopy Create free account
hub / github.com/Extraltodeus/DistanceSampler / blend_add

Function blend_add

custom_samplers.py:212–216  ·  view source on GitHub ↗
(t,v,s)

Source from the content-addressed store, hash-verified

210 return sample_distance_advanced
211
212def blend_add(t,v,s):
213 tn = torch.linalg.norm(t)
214 vn = torch.linalg.norm(v)
215 vp = (v / vn - torch.dot(v / vn, t / tn) * t / tn) * tn
216 return t + vp * s / 2
217
218@torch.no_grad()
219def diff_step(a, b, s):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected