manupak commented on code in PR #12447:
URL: https://github.com/apache/tvm/pull/12447#discussion_r950696665
##########
python/tvm/testing/aot.py:
##########
@@ -931,20 +930,23 @@ def generate_ref_data(mod, input_data, params=None,
target="llvm"):
return dict(zip(output_tensor_names, out))
-def create_relay_module_and_inputs_from_tflite_file(tflite_model_file):
+def create_relay_module_and_inputs_from_tflite_file(tflite_model_file,
bind_params_by_name=True):
"""A helper function to create a Relay IRModule with inputs
and params from a tflite file"""
with open(tflite_model_file, "rb") as f:
tflite_model_buf = f.read()
- mod, params = convert_to_relay(tflite_model_buf)
+ mod, params = convert_to_relay(tflite_model_buf, bind_params_by_name)
inputs = dict()
for param in mod["main"].params:
name = str(param.name_hint)
data_shape = [int(i) for i in param.type_annotation.shape]
dtype = str(param.type_annotation.dtype)
- in_min, in_max = (np.iinfo(dtype).min, np.iinfo(dtype).max)
- data = np.random.randint(in_min, high=in_max, size=data_shape,
dtype=dtype)
+ if dtype == "float32":
Review Comment:
A general title and a short description. There is a ongoing proposal to make
this formal -- https://github.com/apache/tvm-rfcs/pull/88.
For this one, if you can propose and change the title and decription in the
PR, Im happy to use that as the commit title and description to align to
support the above ongoing effort.
--
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]