lucidrains/ema-pytorch

Function parameters confusing in inplace_copy and inplace_lerp

sheshanshag opened this issue · 1 comments

def inplace_copy(src: Tensor, tgt: Tensor, *, auto_move_device = False):
    if auto_move_device:
        tgt = tgt.to(src.device)

    src.copy_(tgt)``

It seems tgt is being copied into src, which is confusing because I read it as src = source and tgt = target. Similarly for inplace_lerp. Is this desirable?

@sheshanshag hey! yea you are right, that is a bit confusing

made the change