Skip to content

Commit

Permalink
Fixed database priority number for fastmath
Browse files Browse the repository at this point in the history
  • Loading branch information
kc611 committed Jan 9, 2022
1 parent 7b03c00 commit 4fe7d29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aesara/tensor/math_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3532,6 +3532,8 @@ def local_reciprocal_1_plus_exp(fgraph, node):
return out


# x_lv, if any, is the logic variable version of some term x,
# while x_at, if any, is the Aesara tensor version for the same.
def distribute_mul_over_add(in_lv, out_lv):
from kanren import conso, eq, fact, heado, tailo

Expand Down Expand Up @@ -3696,7 +3698,7 @@ def distribute_div_over_sub(in_lv, out_lv):

fastmath = EquilibriumDB()

optdb.register("fastmath", fastmath, 0.05, "fast_run", "mul")
optdb.register("fastmath", fastmath, 1, "fast_run", "mul")

fastmath.register(
"dist_mul_over_add_opt",
Expand Down
2 changes: 2 additions & 0 deletions tests/tensor/test_math_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4556,6 +4556,8 @@ class TestDistributiveOpts:
y_at = vector("y")
a_at = matrix("a")

# x_lv, if any, is the logic variable version of some term x,
# while x_at is the Aesara tensor version for the same.
@pytest.mark.parametrize(
"orig_operation, optimized_operation",
[
Expand Down

0 comments on commit 4fe7d29

Please sign in to comment.