You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by lu...@apache.org on 2024/06/18 16:22:48 UTC

(tvm) branch main updated: [Bugfix] Update FAttrsGetter to return Map (#17096)

This is an automated email from the ASF dual-hosted git repository.

lunderberg pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new e58cb27858 [Bugfix] Update FAttrsGetter to return Map<String, ObjectRef> (#17096)
e58cb27858 is described below

commit e58cb27858d2bfb0881d2aa15ab0d82443d97818
Author: Eric Lunderberg <Lu...@users.noreply.github.com>
AuthorDate: Tue Jun 18 11:22:41 2024 -0500

    [Bugfix] Update FAttrsGetter to return Map<String, ObjectRef> (#17096)
    
    Prior to this commit, `FAttrsGetter` was defined as a function that
    returned `Map<String, String>`.  However, it is used to define
    attributes in a `Map<String, ObjectRef>`, and in some cases is used to
    define attributes whose value is a dictionary (e.g. `msc_attrs_getter`
    in `python/tvm/contrib/msc/core/transform/pattern.py`).
    
    This commit updates the type signature of `FAttrsGetter` to match its
    usage, returning a `Map<String, ObjectRef>`.
---
 include/tvm/relax/transform.h   | 2 +-
 src/relax/transform/fuse_ops.cc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/tvm/relax/transform.h b/include/tvm/relax/transform.h
index c3a3c873c0..d8f36e4786 100644
--- a/include/tvm/relax/transform.h
+++ b/include/tvm/relax/transform.h
@@ -367,7 +367,7 @@ class FusionPatternNode : public Object {
    * \brief The function to get attributes for fused function
    *
    * It should have signature
-   * Map<String, String>(const Map<String, Expr>& context)
+   * Map<String, ObjectRef>(const Map<String, Expr>& context)
    */
   Optional<PackedFunc> attrs_getter;
 
diff --git a/src/relax/transform/fuse_ops.cc b/src/relax/transform/fuse_ops.cc
index c4bd52eff1..45d70fc3e2 100644
--- a/src/relax/transform/fuse_ops.cc
+++ b/src/relax/transform/fuse_ops.cc
@@ -1035,7 +1035,7 @@ class PatternBasedPartitioner : ExprVisitor {
   using PatternCheckContext = transform::PatternCheckContext;
   using ExprVisitor::VisitExpr_;
   using FCheckMatch = runtime::TypedPackedFunc<bool(const transform::PatternCheckContext&)>;
-  using FAttrsGetter = runtime::TypedPackedFunc<Map<String, String>(const Map<String, Expr>&)>;
+  using FAttrsGetter = runtime::TypedPackedFunc<Map<String, ObjectRef>(const Map<String, Expr>&)>;
 
   static GroupMap Run(String pattern_name, DFPattern pattern,
                       Map<String, DFPattern> annotation_patterns, FCheckMatch check, Expr expr,