set values of a sub tensor
Open
enhancement
- Dominant language
- C++
- Stars
- 3.4k
- Forks
- 701
- PR merge metrics
- No merged PRs in 30d
Description
It would be great if we could have an operation (e.g., `set_subtensor`) that could set values of given indices of a tensor `X`. In theano this is implemented as [`theano.tensor.set_subtensor`](http://deeplearning.net/software/theano/library/tensor/basic.html#theano.tensor.set_subtensor).
For example:
```
X = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] # tensor of shape (a, b)
idx = [1, 2] # 1-d tensor of shape (k,) where k <= a
values = [[1, 1, 1], [2, 2, 2]] # tensor of shape (k, b)
Y = dy.set_subtensor(X, idx, values)
Y = [[1, 2, 3], [1, 1, 1], [2, 2, 2]]
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.