I have been stuck in a place for a few days, please help, thank you.
I need to convert tensor to mat
Tenser.size()=[288, 384]
Tenser.dtype()=float
However, when I compare the results before and after the conversion, the content of the comparison is inconsistent. May I be mistaken there?
   cout << "score_text sizes=" << score_text.sizes() << "\n";//[288, 384]
   cout << "score_text dtype=" << score_text.dtype() << "\n";  //float


	cv::Mat textmap(score_text.size(0), score_text.size(1), CV_32FC1);
	std::memcpy((void *)textmap.data, score_text.data_ptr(), sizeof(torch::kFloat32) * score_text.numel());//sizeof(torch::kFloat32)
	cout << "textmap rows=" << textmap.rows << "\n"; //textmap rows = 288
	cout << "textmap=" << textmap.size() << "\n";//textmap = [384 x 288]

	for (size_t row = 0; row < textmap.rows; row++) {
		for (size_t col = 0; col < textmap.cols; col++) {
			float textmap_value = textmap.ptr<float>(row)[col];
			float score_text_value = score_text[row][col].item<float>();
			if (textmap_value != score_text_value) {
				cout << "textmap=" << textmap_value << ",score_text_value=" << score_text_value <<  "\n";
			}
		}
	}