How to iterate through a tensor?
Hey follwing example:
I have a tensor that looks like this: (tensor: shape=[1 200 304], dtype=TF_FLOAT, data=...
Now how can iterate through the tensor? With .get_data() I only get the data without the indices. But I want to do something like this:
for (int row=0; row<maxRows; row++){ for (int col=0; col<macCol; col++){ Foo.Bar(my_cpp_tensor[row,col], row, col);}}
How would I do that?
The following example will give you a good idea of how to use a tensor.
https://github.com/serizba/cppflow/blob/883eb4c526979dae56f921571b1ab93df85a0a0d/examples/tensor/main.cpp#L28-L36
It is not possible to use [row, col]. So you have to get the data from the tensor to a vector and index it flatten.
Closing due to inactivity.