Skip to content

Commit

Permalink
add jacobian_var
Browse files Browse the repository at this point in the history
  • Loading branch information
inafergra committed Apr 14, 2024
1 parent 22db86c commit ca975bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions qadence_libs/qinfo_tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ def hessian(output: Tensor, inputs: list[Tensor]) -> Tensor:
n_params = len(inputs)
hess = torch.empty((n_params, n_params))
for i in range(n_params):
jacobian_var = jacobian[i]
ovrlp_grad2 = grad(
jacobian[i],
jacobian_var,
inputs,
torch.ones_like(jacobian[i]),
torch.ones_like(jacobian_var),
create_graph=True,
allow_unused=True,
)
Expand Down

0 comments on commit ca975bf

Please sign in to comment.