mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-23 19:32:23 +00:00
Correctly unpack tensor values (#11639)
This change fixes two issues: * protobuf 3.20 incompatibility * Potential incorrect results on big-endian machines
This commit is contained in:
parent
2ac3649752
commit
03abcb0640
1 changed files with 1 additions and 1 deletions
|
|
@ -256,7 +256,7 @@ Status UnpackTensor(const ONNX_NAMESPACE::TensorProto& tensor, const void* raw_d
|
|||
") does not match the data size(", tensor.field_size(), ") in proto"); \
|
||||
auto& data = tensor.field_name(); \
|
||||
for (auto data_iter = data.cbegin(); data_iter != data.cend(); ++data_iter) \
|
||||
*p_data++ = *reinterpret_cast<const T*>(data_iter); \
|
||||
*p_data++ = static_cast<T>(*data_iter); \
|
||||
return Status::OK(); \
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue