'Assigning values from 3d tensor to 4d one
I have a 4D tensor, tails, and a 3D one, tail. I want to assign values of 3D tensor to first 'row' of the 4D tensor, but I am not getting any change in values in a tails array.
>>> tail.shape
(32,32,3)
>>> tails.shape
(350,32,32,3)
>>> tails[1].shape
(32,32,3)
>>>tails[1] = tail
Solution 1:[1]
Indexes start at 0 in Python, so to access the first row of tails you will need to write tails[0].
Also, there is an answer talking about a similar problem here.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Stimmot |
