Mousius commented on a change in pull request #8720:
URL: https://github.com/apache/tvm/pull/8720#discussion_r689390564



##########
File path: python/tvm/micro/interface_api.py
##########
@@ -59,7 +60,8 @@ def generate_c_interface_header(module_name, inputs, outputs, 
output_path):
         _emit_brief(header_file, module_name, "Input tensor pointers")
         header_file.write(f"struct {mangled_name}_inputs {{\n")
         for input_name in inputs:
-            header_file.write(f"  void* {input_name};\n")
+            sanitized_input_name = re.sub(r"\W+", "_", input_name)

Review comment:
       This is a good spot @leandron! When compared with the C++ implementation 
(`std::replace_if(sanitised_input.begin(), sanitised_input.end(), ::ispunct, 
'_');`) it will produce a different output as well I think, `x::2` would be 
`x__2` in C++ and `x_2` in Python?
   
   @grant-arm can we add some test cases for multiple punctuation?




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