You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "masahi (via GitHub)" <gi...@apache.org> on 2023/04/05 09:09:22 UTC

[GitHub] [tvm] masahi commented on a diff in pull request #14507: [Unity] Use NameSupply for unique symbol generation and remove NameTable

masahi commented on code in PR #14507:
URL: https://github.com/apache/tvm/pull/14507#discussion_r1158243493


##########
include/tvm/ir/name_supply.h:
##########
@@ -54,9 +54,11 @@ class NameSupplyNode : public Object {
    * \brief Generates a unique name from this NameSupply.
    * \param name The name from which the generated name is derived.
    * \param add_prefix If set to true, then the prefix of this NameSupply will be prepended to the
-   * name. \return A unique name.
+   * name.
+   * \param add_underscore If set to true, add '_' between prefix and a digit.
+   * \return A unique name.
    */
-  String FreshName(const String& name, bool add_prefix = true);
+  String FreshName(const String& name, bool add_prefix = true, bool add_underscore = true);

Review Comment:
   This change is only for backward-compat according to the variable naming convention of `BlockBuilder` (`lv1` vs `lv_1`). `NameSupply` adds an underscore before a digit by default. 
   
   If we are ok with introducing such trivial variable naming change, I'm more than happy to remove this diff.



##########
include/tvm/ir/name_supply.h:
##########
@@ -54,9 +54,11 @@ class NameSupplyNode : public Object {
    * \brief Generates a unique name from this NameSupply.
    * \param name The name from which the generated name is derived.
    * \param add_prefix If set to true, then the prefix of this NameSupply will be prepended to the
-   * name. \return A unique name.
+   * name.
+   * \param add_underscore If set to true, add '_' between prefix and a digit.
+   * \return A unique name.
    */
-  String FreshName(const String& name, bool add_prefix = true);
+  String FreshName(const String& name, bool add_prefix = true, bool add_underscore = true);

Review Comment:
   This change is only for backward-compat purpose according to the variable naming convention of `BlockBuilder` (`lv1` vs `lv_1`). `NameSupply` adds an underscore before a digit by default. 
   
   If we are ok with introducing such trivial variable naming change, I'm more than happy to remove this diff.



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