You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/08/18 18:46:42 UTC

[GitHub] [tvm] grant-arm commented on a change in pull request #8720: Sanitize names of input tensors in interface header

grant-arm commented on a change in pull request #8720:
URL: https://github.com/apache/tvm/pull/8720#discussion_r691516408



##########
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:
       Thanks @leandron & @Mousius. Good catch!
   I've updated the python code that sanitizes the names and updated the test case to include a tensor name with 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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org