remove old fns
@@ -262,15 +262,8 @@ def module(pyro_name, nn_obj, tags="default", load_from_param_store=False):
def _cdata(t):
if isinstance(t, torch.autograd.Variable):
return t.data._cdata
- else:
return t._cdata
- # copy in place; supports both Variable and Tensor args
- def _copy_in_place(source, target):
- t = target.data if isinstance(target, torch.autograd.Variable) else target
- s = source.data if isinstance(source, torch.autograd.Variable) else source
- t.copy_(s)
-
target_state_dict = OrderedDict()
for param_name, param in nn_obj.named_parameters():
@@ -281,7 +274,6 @@ def module(pyro_name, nn_obj, tags="default", load_from_param_store=False):
# optional: if the data behind the parameter in the actual module is stale w.r.t. the parameter
if _cdata(param) != _cdata(returned_param):
- # # _copy_in_place(source=returned_param, target=param)
target_state_dict[param_name] = returned_param
if load_from_param_store:
pyro.get_param_store().replace_param(full_param_name, new_param=param, old_param=returned_param)
