I have a tensor like
[[0, 0, 0, 1, 0, 0],
[0, 3, 0, 0, 0, 1],
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 2, 0, 0],
[0, 0, 0, 0, 0, 0]]
How do i produce a tensor containing only the non-zero indices of the former?
[[0,3],[1,1],[1,5],[4,3]]
I'm on tfjs so it doesn't appear to have boolean_mask or some other helpful functions others seem to use in indexing. Is this possible without using the .data() escape hatch and map/filtering over the array? (i'm just using tensorflow for its fast linear algebra methods so that wouldn't be the worst, right?)