You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
param_size = hv.size()
if len(param_size) <= 2: # for 0/1/2D tensor
# Hessian diagonal block size is 1 here.
# We use that torch.abs(hv * vi) = hv.abs()
tmp_output = hv.abs()
elif len(param_size) == 4: # Conv kernel
# Hessian diagonal block size is 9 here: torch.sum() reduces
# the dim 2/3.
# We use that torch.abs(hv * vi) = hv.abs()
tmp_output = torch.mean(hv.abs(), dim=[2, 3], keepdim=True)
hutchinson_trace.append(tmp_output)
this resutls in an error:
python3.10/site-packages/torch_optimizer/adahessian.py", line 128, in get_trace
hutchinson_trace.append(tmp_output)
UnboundLocalError: local variable 'tmp_output' referenced before assignment
The text was updated successfully, but these errors were encountered:
this resutls in an error:
The text was updated successfully, but these errors were encountered: