zhiics commented on a change in pull request #5770: URL: https://github.com/apache/incubator-tvm/pull/5770#discussion_r441302269
########## File path: python/tvm/contrib/graph_runtime.py ########## @@ -162,7 +162,11 @@ def set_input(self, key=None, value=None, **params): keys = list(params.keys()) keys.sort(key=lambda x: -np.prod(params[x].shape)) for k in keys: - self._get_input(k).copyfrom(params[k]) + # TODO(zhiics) Skip the weights for submodule in a better way. + # We could get all inputs required by graphruntime first, + # we should use MetadataModule for initialization. + if "_const_" not in k: Review comment: Yes, the constants for graph runtime all start with "p" https://github.com/apache/incubator-tvm/blob/3e72be58f362a21dbcc1de36f9dbed216e854baf/src/relay/backend/graph_runtime_codegen.cc#L314 However, as the TODO says, we should have a better way to handle this. But graph runtime current doesn't really distinguish input/weights. I think we can use this simple workaround from the frontend for now. ---------------------------------------------------------------- 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: us...@infra.apache.org