For arr[i][j] = 1 just do `relay.ones` instead of `relay.zeros`

For arr[i][j] += 1 use `scatter_add`. 

Scatter_add:

```
  output[indices[i][j]][j] += updates[i][j] if axis = 0,
  output[i][indices[i][j]] += updates[i][j] if axis = 1,
```

If scatter_add is insufficient, then you will need to use scatter_nd with 'add' 
mode.

The scatter_nd is pretty complicated but a few examples and you should know 
what is going on. It is pretty standard operator in Deep Learning. Here is an 
example: https://github.com/onnx/onnx/blob/master/docs/Operators.md#scatternd





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/relay-what-does-relay-take-mean-is-it-a-copy-or-a-reference/11437/6)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/4891c6aaf5d8c3b6250e5dda8882a119cd2d2e3666081424f2baaf50190c64e7).

Reply via email to