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 2020/09/15 04:38:53 UTC

[GitHub] [incubator-tvm] yongwww commented on pull request #6472: Add several op mapping in PyTorch frontend

yongwww commented on pull request #6472:
URL: https://github.com/apache/incubator-tvm/pull/6472#issuecomment-692458938


   @masahi we found `copy_` exists in mask-rcnn model exported from https://github.com/facebookresearch/maskrcnn-benchmark, the mapping in this pr is good enough to support that and the test cases I prepared in this pr. 
   
   Have added a test cases `class CopyInPlace(Module)` to cover this inplace copy, we can pass the test cases, reason is the jit graph would not point to the original tensor after `torch.Tensor.copy_`.  For example, in the following code snippet,  to use `a` after `copy_` 
   
   ```
   a = torch.rand((2, 3))
   b = torch.rand((2, ))
   c = torch.Tensor.copy_(a, b)
   return a # a is supposed to be original one, but in jit graph, it is the same as c
   ``` 
   
   related graph:
   
   ```
    graph(%self : __torch__.___torch_mangle_10.CopyInPlace,
         %a : Float(2, 3, 5),
         %b : Float(2, 3, 5)):
     %3 : bool = prim::Constant[value=0]()
     %4 : Float(2, 3, 5) = aten::copy_(%a, %b, %3)
     return (%4)
   ```
   


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