fPecc commented on code in PR #12789:
URL: https://github.com/apache/tvm/pull/12789#discussion_r1029073426
##########
python/tvm/micro/model_library_format.py:
##########
@@ -277,6 +294,37 @@ def _create_empty_entry(target_device_type):
main_func_metadata.io_sizes[target]
)
+ # Now, we also add the information about the size of each input and
output of the main
+ # function (in bytes)
+ input_dict = {}
+ for input_param in main_func_metadata.relay_primfuncs[target].params:
+ if hasattr(input_param, "checked_type"):
+ input_dict[input_param.name_hint] = int(
+ _shape_to_size(input_param.checked_type.shape,
input_param.checked_type.dtype)
+ )
+ else:
+ # TODO: maybe fill checked_type here?
+ input_dict[input_param.name_hint] = 0
+ target_main_entries[int(target.kind.device_type)]["inputs"] =
input_dict
+
+ output_dict = {}
+ # For output, we dont have the name of the output, so we enumerate them
+ if isinstance(main_func_metadata.relay_primfuncs[target].ret_type,
tvm.ir.type.TupleType):
Review Comment:
Applied the proposed change
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]