Skip to content

Commit

Permalink
fix init={} being modified inplace
Browse files Browse the repository at this point in the history
  • Loading branch information
yocabon committed Jul 25, 2024
1 parent d1c9c7b commit b587bb3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mast3r/cloud_opt/sparse_ga.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from collections import namedtuple
from functools import lru_cache
from scipy import sparse as sp
import copy

from mast3r.utils.misc import mkdir_for, hash_md5
from mast3r.cloud_opt.utils.losses import gamma_loss
Expand Down Expand Up @@ -166,7 +167,7 @@ def sparse_scene_optimizer(imgs, subsample, imsizes, pps, base_focals, core_dept
init={}, device='cuda', dtype=torch.float32,
matching_conf_thr=5., loss_dust3r_w=0.01,
verbose=True, dbg=()):

init = copy.deepcopy(init)
# extrinsic parameters
vec0001 = torch.tensor((0, 0, 0, 1), dtype=dtype, device=device)
quats = [nn.Parameter(vec0001.clone()) for _ in range(len(imgs))]
Expand Down

0 comments on commit b587bb3

Please sign in to comment.