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

[FRONTEND][TENSORFLOW] support multiply outputs #4980

Merged
merged 2 commits into from
Mar 8, 2020
Merged
Changes from 1 commit
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 python/tvm/relay/testing/tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ def ProcessGraphDefParam(graph_def):
return graph_def


def convert_to_list(x):
if not isinstance(x, list):
x = [x]
return x

def AddShapesToGraphDef(session, out_node):
""" Add shapes attribute to nodes of the graph.
Input graph here is the default graph in context.
Expand All @@ -74,7 +79,7 @@ def AddShapesToGraphDef(session, out_node):
----------
session : tf.Session
Tensorflow session
out_node : String
out_node : String or List
Final output node of the graph.

Returns
Expand All @@ -87,7 +92,7 @@ def AddShapesToGraphDef(session, out_node):
graph_def = tf_compat_v1.graph_util.convert_variables_to_constants(
session,
session.graph.as_graph_def(add_shapes=True),
[out_node],
convert_to_list(out_node),
)
return graph_def

Expand Down