Skip to content

Commit b504958

Browse files
Merge pull request #92 from brandonwillard/fix-opdef-unify
Fix unification for meta objects without properties
2 parents 8011195 + ca142fa commit b504958

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

symbolic_pymc/unify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def wrapper(*args, **kwargs):
4646
def unify_MetaSymbol(u, v, s):
4747
if type(u) != type(v):
4848
return False
49-
if hasattr(u, "__all_props__"):
49+
if getattr(u, "__all_props__", False):
5050
s = unify(
5151
[getattr(u, slot) for slot in u.__all_props__],
5252
[getattr(v, slot) for slot in v.__all_props__],

tests/tensorflow/test_meta.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@ def test_opdef_func():
567567
with tf.compat.v1.Session() as sess:
568568
assert sum_tf.eval() == np.r_[3]
569569

570-
571570
@run_in_graph_mode
572571
def test_tensor_ops():
573572

tests/tensorflow/test_unify.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ def test_operator():
2323

2424
assert add_mt == mt.add
2525

26+
assert unify(mt.mul, mt.matmul) is False
27+
assert unify(mt.mul.op_def, mt.matmul.op_def) is False
28+
2629

2730
@run_in_graph_mode
2831
def test_etuple_term():

0 commit comments

Comments
 (0)