|
|
|
@ -36,6 +36,8 @@ struct DataReader {
|
|
|
|
|
tensor.lod.front().push_back(data.size());
|
|
|
|
|
|
|
|
|
|
tensor.data.Resize(data.size() * sizeof(int64_t));
|
|
|
|
|
CHECK(tensor.data.data() != nullptr);
|
|
|
|
|
CHECK(data.data() != nullptr);
|
|
|
|
|
memcpy(tensor.data.data(), data.data(), data.size() * sizeof(int64_t));
|
|
|
|
|
tensor.shape.push_back(data.size());
|
|
|
|
|
tensor.shape.push_back(1);
|
|
|
|
@ -87,7 +89,12 @@ TEST(Analyzer_Text_Classification, profile) {
|
|
|
|
|
CHECK_EQ(output.lod.size(), 0UL);
|
|
|
|
|
LOG(INFO) << "output.dtype: " << output.dtype;
|
|
|
|
|
std::stringstream ss;
|
|
|
|
|
for (int i = 0; i < 5; i++) {
|
|
|
|
|
int num_data = 1;
|
|
|
|
|
for (auto i : output.shape) {
|
|
|
|
|
num_data *= i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < num_data; i++) {
|
|
|
|
|
ss << static_cast<float *>(output.data.data())[i] << " ";
|
|
|
|
|
}
|
|
|
|
|
LOG(INFO) << "output.data summary: " << ss.str();
|
|
|
|
|