Skip to content

Commit

Permalink
Fix: Discard cache when assigning new parameters in CircuitData.
Browse files Browse the repository at this point in the history
  • Loading branch information
raynelfss committed Dec 11, 2024
1 parent 892f2fa commit 76f7dff
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions crates/circuit/src/circuit_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1394,13 +1394,7 @@ impl CircuitData {
// Standard gates can all rebuild their definitions, so if the
// cached py_op exists, update the `params` attribute and clear out
// any existing cache.
if let Some(borrowed) = previous.py_op.get() {
borrowed
.bind(py)
.getattr(params_attr)?
.set_item(parameter, new_param)?;
borrowed.bind(py).setattr("_definition", py.None())?
}
previous.py_op.take();
}
} else {
// Track user operations we've seen so we can rebind their definitions.
Expand Down

0 comments on commit 76f7dff

Please sign in to comment.