I have a length tensor in a tensor flow, let's say it looks like this:
[4, 3, 5, 2]
I want to create a mask 1s and 0s, the number of which corresponds to the elements of this tensor filled with 0s, up to a total length of 8. Ie I want to create this tensor:
[[1,1,1,1,0,0,0,0], [1,1,1,0,0,0,0,0], [1,1,1,1,1,0,0,0], [1,1,0,0,0,0,0,0] ]
How can i do this?
arrays tensorflow masking
Evan pu
source share