merrymercy commented on a change in pull request #6391:
URL: https://github.com/apache/incubator-tvm/pull/6391#discussion_r483592006



##########
File path: python/tvm/auto_scheduler/measure.py
##########
@@ -566,9 +592,13 @@ def timed_func(inp, build_res):
 
         if error_no == 0:
             try:
-                # TODO(FrozenGene): Update to ndarray.non-empty.
                 args = [ndarray.empty(get_const_tuple(x.shape), x.dtype, ctx) 
for x in
                         build_res.args]
+                assert tvm.get_global_func("tvm.contrib.random.random_fill", 
True), \
+                    "Do you enable USE_RANDOM in the config.cmake?"
+                random_fill = 
tvm.get_global_func("tvm.contrib.random.random_fill")

Review comment:
       We should call `tvm.get_global_func` only once
   ```
   random_fill = tvm.get_global_func("tvm.contrib.random.random_fill", True)
   assert random_fill is not None, "Please set USE_RANDOM to ON in the 
config.cmake"
   ```




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


Reply via email to