Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with TF > 1.7.0 #891

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions edward/util/random_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@
from edward.models import PointMass
from edward.util.graphs import random_variables
from tensorflow.core.framework import attr_value_pb2
from tensorflow.python.framework.ops import set_shapes_for_outputs
import sys
try:
from tensorflow.python.framework.ops import set_shapes_for_outputs
except ImportError as e:
print('Using newer version of Tensorflow where set_shapes_for_outputs has been deprecated')
from tensorflow.python.util import compat

set_shapes_module_ = 'set_shapes_for_outputs'
tfb = tf.contrib.distributions.bijectors


Expand Down Expand Up @@ -401,7 +406,7 @@ def copy(org_instance, dict_swap=None, scope="copied",
compute_device = True
op_type = new_name

if compute_shapes:
if compute_shapes and set_shapes_module_ in sys.modules:
set_shapes_for_outputs(new_op)
graph._record_op_seen_by_control_dependencies(new_op)

Expand Down