Closed srilekha1993 closed 1 year ago
If you have a flat tensor one easy way to go is to call tensor::get_data<T>()
to get a vector and then iterate over it and print the values.
Hi serizba,
As my tensor name is output
so for(auto i:output::get_data
In function ‘int main()’:
first_exp.cpp:155:16: error: ‘output’ is not a class, namespace, or enumeration
155 | for(auto i:output::get_data~
first_exp.cpp:155:33: error: expected primary-expression before ‘float’
155 | for(auto i:output::get_data
You should try output.get_data<float>()
Thanks @serizba it worked now
I have cppflow output tensor looking like this [[0.000991769251 0.00138346222 0.00149751361 ... 1.76803405e-05 -7.28769791e-08 -8.21208062e-07]]) of shape (1,16000). I want to print all the entries of this tensor using cppflow. I have tried with cppflow::print() but it is defined similarly to the TensorFlow 1.x format where it takes the input graph and the data input, but in my case only one output tensor no graph is there. I wanted to use similar to the tf. print() in tensorflw2.x. So can someone help me out in this regard?