wx3000 commented on a change in pull request #7498:
URL: https://github.com/apache/tvm/pull/7498#discussion_r580712245
##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -3682,6 +3729,30 @@ def from_tensorflow(graph, layout="NHWC", shape=None,
outputs=None):
params : dict of str to tvm.nd.NDArray
Dict of converted parameters stored in tvm.nd.NDArray format
"""
+ from tensorflow.python.eager.function import ConcreteFunction
+
+ if isinstance(graph, ConcreteFunction):
Review comment:
would it be better if we create a wrapper over from_tensorflow() instead
of overloading the parameter "graph" to be either GraphDef or ConcreteFunction?
Another question: Is ConcreteFunction the right entry point? Why not start
from the saved_model format? When TVM is used to compile a model for inference,
it starts from a saved_model. This way there is no need to use
_build_signature_def in order to optimize the graph. Maybe _build_signature_def
can be part of the test utility code.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]