t-vi commented on pull request #7231: URL: https://github.com/apache/tvm/pull/7231#issuecomment-764527672
To keep things transparent, I'm copying a terse bit of explanation from slack: To see what goes wrong and why the test doesn't catch it, compare the graph for traced and scripted in the above function (or in the equivalent module). They crucially differ in the input to `mul`. So for just `unsqueeze_` you could get by with the same trick of just replacing the node you recorded for the input by the output. To properly support inplace (say for `copy_`), you would need to keep track of aliases in the TVM PyTorch frontend. I think that it is possible, but you need to actually implement the bookkeeping it involves (i.e. keep track of which tensor is a view of what and which operations have been carried out on them, then when the tensor is accessed, you need to check whether you need to "build" the inplace-modified tensor). It is a bit of work, but it certainly is possible if you're determined. ---------------------------------------------------------------- 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: [email protected]
