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/04/07 03:47:41 UTC

[GitHub] [tvm] junrushao1994 edited a comment on issue #7805: [TIR][Bug] The buffer map, parameters and body do not agree on buffer variable identity.

junrushao1994 edited a comment on issue #7805:
URL: https://github.com/apache/tvm/issues/7805#issuecomment-814577630


   Yeah it looks like the params in the PrimFunc signature are not the variables used in the function body.
   
   ```python
   pf = lowered["main"]
   # `addr1` is the variable in the function signature
   addr1 = pf.params[0].handle
   # `addr2` is the variable contained in the corresponding buffer
   addr2 = pf.buffer_map[pf.params[0]].data.handle
   # `addr3` is the variable used in the function body
   addr3 = pf.body.body.value.a.buffer_var.handle
   
   # we can see addr2==addr3, but addr1 != addr2
   print(addr1)
   print(addr2)
   print(addr3)
   ```
   
   So the vars in the function signature are not the ones used in the function body, but it can be somehow retrieved from the buffer_map. Is this or a bug or intentional? like, to avoid cyclic dependency? @tqchen 


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