tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] tqchen opened a new pull request #5045: [REFACTOR] Streamline Function Attr interface.
Date Wed, 11 Mar 2020 21:36:23 GMT
tqchen opened a new pull request #5045: [REFACTOR] Streamline Function Attr interface.
URL: https://github.com/apache/incubator-tvm/pull/5045
 
 
   There has been quite a few recent changes that depends heavily on
   the function attr interface. This PR streamlines that interface by introducing
   two APIs that covers most of the usages.
   
   - GetAttr which gets a typed object for a given key
     - HasNonzeroAttr is a quick helper that calls GetAttr to quickly check an attribute
   - WithAttr that creates a new function object with the given attr
     - The API comes with copy on write optimization to avoid multiple copies
     - We deliberately pick the prefix With(instead of Set) to indicate this
       function does not mutate the original input.
   
   On the python side:
   - We allow read access via func.attrs (which is a DictAttr)
   - func.with_attrs to create a new instance with updated attrs.
   
   We also get rid of the small wrapper functions and make sure the API centered around
   the GetAttr and HasNonzeroAttr interface.
   
   This PR also changes the function construction to follow the new convention.
   
   cc @jroesch @zhiics @mbaret 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message