Skip to content

Commit 2fbc860

Browse files
Merge pull request #63 from brandonwillard/fix-tflow-op-name-metatize
Do not attempt to metatize TFlowOpNames
2 parents 24d342b + cb11f6c commit 2fbc860

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
scipy>=1.2.0
22
Theano>=1.0.4
33
tf-nightly-2.0-preview==2.0.0.dev20190606
4-
tfp-nightly>=0.7.0.dev20190320
4+
tfp-nightly==0.8.0.dev20190705
55
pymc3>=3.6
66
pymc4 @ git+https://github.com/pymc-devs/pymc4.git@master#egg=pymc4-0.0.1
77
multipledispatch>=0.6.0

symbolic_pymc/tensorflow/meta.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ def __hash__(self):
177177
return hash((self._unique_name, self._in_idx))
178178

179179

180+
_metatize.add((TFlowOpName,), lambda x: x)
181+
182+
180183
def _metatize_tf_object(obj):
181184
try:
182185
obj = tf.convert_to_tensor(obj)

tests/tensorflow/test_meta.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ def test_op_names():
4141
# but not output numbers
4242
assert TFlowOpName('blah/add_1:0') != TFlowOpName('blah/add:1')
4343

44+
assert isinstance(mt(TFlowOpName('blah/add_1:0')), TFlowOpName)
45+
4446

4547
@pytest.mark.usefixtures("run_with_tensorflow")
4648
def test_meta_helper():

0 commit comments

Comments
 (0)