Skip to content

Commit

Permalink
moved list
Browse files Browse the repository at this point in the history
Signed-off-by: Melvin Strobl <[email protected]>
  • Loading branch information
Melvin Strobl committed Nov 15, 2024
1 parent e8aa652 commit 8bad289
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions qml_essentials/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,10 @@ def _forward(
inputs=inputs,
)

if isinstance(result, list):
result = np.stack(result)

if self.execution_type == "expval" and self.output_qubit == -1:
if isinstance(result, list):
result = np.stack(result)

# Calculating mean value after stacking, to not
# discard gradient information
Expand Down

0 comments on commit 8bad289

Please sign in to comment.