zxybazh commented on code in PR #11298:
URL: https://github.com/apache/tvm/pull/11298#discussion_r874276006


##########
python/tvm/meta_schedule/testing/tune_relay_meta_schedule.py:
##########
@@ -159,17 +164,18 @@ def f_timer(rt_mod, dev, input_data):
         rpc_config=ARGS.rpc_config,
         lib=lib,
         dev_type=ARGS.target.kind.name,
-        args=[input_data],
+        args=inputs,

Review Comment:
   IMO it's better to use a dict instead of list right?



##########
python/tvm/meta_schedule/testing/tune_relay_meta_schedule.py:
##########
@@ -133,19 +136,21 @@ def main():
         params=params,
     )
     graph, rt_mod, params = lib.graph_json, lib.lib, lib.params
-    if input_dtype.startswith("float"):
-        input_data = np.random.uniform(size=input_shape).astype(input_dtype)
-    else:
-        input_data = np.random.randint(low=0, high=10000, size=input_shape, 
dtype=input_dtype)
+    for input_name, input_shape in input_info.items():
+        if input_dtype.startswith("float"):
+            
inputs.append(np.random.uniform(size=input_shape).astype(input_dtype))
+        else:
+            inputs.append(np.random.randint(low=0, high=10000, 
size=input_shape, dtype=input_dtype))
 
-    def f_timer(rt_mod, dev, input_data):

Review Comment:
   `input_data` sounds more reasonable to me than just `inputs` but I don't 
have very strong opinion here.



##########
python/tvm/meta_schedule/testing/tune_relay_auto_scheduler.py:
##########
@@ -196,17 +201,18 @@ def f_timer(rt_mod, dev, input_data):
         rpc_config=ARGS.rpc_config,
         lib=lib,
         dev_type=ARGS.target.kind.name,
-        args=[input_data],
+        args=inputs,
         continuation=f_timer,
     )
 
-    def f_per_layer(rt_mod, dev, input_data):
+    def f_per_layer(rt_mod, dev, inputs):

Review Comment:
   Same as below.



##########
python/tvm/meta_schedule/testing/tune_relay_auto_scheduler.py:
##########
@@ -170,19 +173,21 @@ def main():
                 params=params,
             )
     graph, rt_mod, params = lib.graph_json, lib.lib, lib.params
-    if input_dtype.startswith("float"):
-        input_data = np.random.uniform(size=input_shape).astype(input_dtype)
-    else:
-        input_data = np.random.randint(low=0, high=10000, size=input_shape, 
dtype=input_dtype)
+    for input_name, input_shape in input_info.items():
+        if input_dtype.startswith("float"):
+            
inputs.append(np.random.uniform(size=input_shape).astype(input_dtype))
+        else:
+            inputs.append(np.random.randint(low=0, high=10000, 
size=input_shape, dtype=input_dtype))

Review Comment:
   Same as below.



-- 
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]

Reply via email to