Skip to content

Commit 484cca2

Browse files
committed
Remove OrderedDict from tests/test_gradient
1 parent 74e2eed commit 484cca2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/test_gradient.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from collections import OrderedDict
2-
31
import numpy as np
42
import pytest
53

@@ -637,7 +635,7 @@ def test_known_grads():
637635

638636
for layer in layers:
639637
first = grad(cost, layer, disconnected_inputs="ignore")
640-
known = OrderedDict(zip(layer, first))
638+
known = dict(zip(layer, first))
641639
full = grad(
642640
cost=None, known_grads=known, wrt=inputs, disconnected_inputs="ignore"
643641
)
@@ -755,7 +753,7 @@ def test_subgraph_grad():
755753
param_grad, next_grad = subgraph_grad(
756754
wrt=params[i], end=grad_ends[i], start=next_grad, cost=costs[i]
757755
)
758-
next_grad = OrderedDict(zip(grad_ends[i], next_grad))
756+
next_grad = dict(zip(grad_ends[i], next_grad))
759757
param_grads.extend(param_grad)
760758

761759
pgrads = pytensor.function(inputs, param_grads)

0 commit comments

Comments
 (0)