Closed xinsuinizhuan closed 4 years ago
Are you sure the data is losing precision or is it just being printed with a lower precision?
You can use
int precision = 5;
tensor.print(precision);
To change the output precision.
Likewise to copy data from a vector you could even just do... (assuming no cuda) for (int i = 0; i < vector.size(); ++i) { tensor.data()[i] = vector[i]; }
Or better yet:
BC::copy(BC::Stream<system_tag>(), vector.begin(), vector.end(), tensor.cw_begin());
BC::copy(BC::Stream
(), vector.begin(), vector.end(), tensor.cw_begin());
OK. I am so sorry.Data conver precision is ok,i am use the "print(3)".
No problem!
I use this way to inputdata to system:![图片](https://user-images.githubusercontent.com/40679769/66807753-5db9d400-ef5c-11e9-8a5b-3e225168e46c.png)
my original double data:
when i conver it to inner:
my convered double data precision is %1f. How should i do?