tqchen commented on a change in pull request #10712:
URL: https://github.com/apache/tvm/pull/10712#discussion_r833355004



##########
File path: python/tvm/runtime/ndarray.py
##########
@@ -249,6 +249,28 @@ def copyto(self, target):
             return self._copyto(res)
         raise ValueError("Unsupported target type %s" % str(type(target)))
 
+    def create_view(self, shape):

Review comment:
       Consider make it _create_view for now. 
   
   Using views extensively can be unsafe, and should be discouraged. Note that 
most of TVM function compiled assumes no-alias, which works well when views are 
not created in frontend. No-alias is generally needed for performance. 
   
   The lower-level can choose to create views, but still with care that the 
views do not alias in each call
   
   The particular application of logical/physical layout is a good one that can 
use the low-level API. but would also be good to think how to make the API safe 
in the first place(e.g. when specify the physical shape we "consume" the 
original tensor so it will no longer be used).
   
   Mark it as private with note would help to make this issue clear. 




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to