MCPcopy Create free account
hub / github.com/CompVis/diff2flow / inplace_copy

Function inplace_copy

diff2flow/ema.py:20–24  ·  view source on GitHub ↗
(src: Tensor, tgt: Tensor, *, auto_move_device = False)

Source from the content-addressed store, hash-verified

18 return next(m.parameters()).device
19
20def inplace_copy(src: Tensor, tgt: Tensor, *, auto_move_device = False):
21 if auto_move_device:
22 tgt = tgt.to(src.device)
23
24 src.copy_(tgt)
25
26def inplace_lerp(src: Tensor, tgt: Tensor, weight, *, auto_move_device = False):
27 if auto_move_device:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected