guberti commented on code in PR #13845:
URL: https://github.com/apache/tvm/pull/13845#discussion_r1088396242


##########
gallery/how_to/work_with_microtvm/micro_pytorch.py:
##########
@@ -93,11 +93,11 @@
 # would run on a physical microcontroller.
 #
 
-
 # Simulate a microcontroller on the host machine. Uses the main() from 
`src/runtime/crt/host/main.cc`
-# To use physical hardware, replace "host" with another physical micro target, 
e.g. `nrf52840`
-# or `mps2_an521`. See more more target examples in micro_train.py and 
micro_tflite.py tutorials.
-target = tvm.target.target.micro("host")
+# To use physical hardware, replace `board` with another physical micro 
target, e.g. `nrf5340dk_nrf5340_cpuapp`
+# or `mps2_an521` and change the platform type to Zephyr.
+# See more more target examples in micro_train.py and micro_tflite.py 
tutorials.

Review Comment:
   Can we mention these tutorials in text instead of in a code comment? That 
way we can add clickable links.



##########
python/tvm/micro/testing/utils.py:
##########
@@ -47,10 +47,13 @@ def get_supported_boards(platform: str):
         return json.load(f)
 
 
-def get_target(platform: str, board: str) -> tvm.target.Target:
+def get_target(platform: str, board: str = None) -> tvm.target.Target:
     """Intentionally simple function for making Targets for microcontrollers.
     If you need more complex arguments, one should call target.micro directly. 
Note
     that almost all, but not all, supported microcontrollers are Arm-based."""
+    if platform == "crt":
+        return tvm.target.target.micro("host")
+

Review Comment:
   Can we throw a better error if `platform` is _not_ `"crt"` and `board` is 
`None`?



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