[Apache TVM Discuss] [Questions] Index_put operator in Relay

2021-02-17 Thread Alexander Pivovarov via Apache TVM Discuss
PR to add `torch.index_put` operator to TVM PyTorch frontend https://github.com/apache/tvm/pull/7465 --- [Visit Topic](https://discuss.tvm.apache.org/t/index-put-operator-in-relay/9094/7) to respond. You are receiving this because you enabled mailing list mode. To unsubscribe from these

[Apache TVM Discuss] [Questions] Index_put operator in Relay

2021-02-16 Thread Alexander Pivovarov via Apache TVM Discuss
I faced an issue with scatter_nd and concatenate https://discuss.tvm.apache.org/t/scatter-nd-and-concatenate-fails/9138 --- [Visit Topic](https://discuss.tvm.apache.org/t/index-put-operator-in-relay/9094/6) to respond. You are receiving this because you enabled mailing list mode. To uns

[Apache TVM Discuss] [Questions] Index_put operator in Relay

2021-02-09 Thread Alexander Pivovarov via Apache TVM Discuss
`scatter_nd` might work if we assume that `input_put_` usually sets the values to empty tensor. ``` ctx = tvm.cpu(0) target = 'llvm' dtype = 'float32' shape = (3,3) tp = relay.TensorType(shape) data = np.random.rand(*shape).astype(dtype) hs = [0, 1, 2, 2] ws = [0, 1, 1, 2] vs = [2.0, 4.0, 7.0,

[Apache TVM Discuss] [Questions] Index_put operator in Relay

2021-02-09 Thread Alexander Pivovarov via Apache TVM Discuss
Actual torchscript from some model looks the following torchscript Python: ``` output = torch.zeros([_17, int(num_channels), 7, 7], dtype=6, layout=None, pin_memory=False) output0 = torch.index_put_(output, _20, _19, False) ``` torchscript IR: ``` %output.1 : Float(1000, 256, 7, 7, str

[Apache TVM Discuss] [Questions] Index_put operator in Relay

2021-02-09 Thread Tristan Konolige via Apache TVM Discuss
Note that Relay is a functional language, so modify tensors in place is awkward. In this case, the tensor you are modifying has zeros by default, so you can use `scatter_nd`. --- [Visit Topic](https://discuss.tvm.apache.org/t/index-put-operator-in-relay/9094/3) to respond. You are recei

[Apache TVM Discuss] [Questions] Index_put operator in Relay

2021-02-08 Thread masahi via Apache TVM Discuss
Probably `scatter_nd`, see https://github.com/apache/tvm/pull/6854 --- [Visit Topic](https://discuss.tvm.apache.org/t/index-put-operator-in-relay/9094/2) to respond. You are receiving this because you enabled mailing list mode. To unsubscribe from these emails, [click here](https://disc

[Apache TVM Discuss] [Questions] Index_put operator in Relay

2021-02-08 Thread Alexander Pivovarov via Apache TVM Discuss
What operator in Relay can be used to set multiple values to a given tensor? Lets say I have 3x3 tensor "A" and I need to set ``` A[0,0] = 2.0 A[1,1] = 4.0 A[2,1] = 7.0 A[2,2] = 9.0 ``` PyTorch code: ``` A = torch.zeros(3,3) hs = torch.tensor([0, 1, 2, 2]) ws = torch.tensor([0, 1, 1, 2]) vs =