@@ -191,9 +191,9 @@ InferContext::GetInputs()
191
191
{
192
192
RequestRecord::RequestInput input{};
193
193
for (const auto & request_input : infer_data_.valid_inputs_ ) {
194
+ std::string data_type{request_input->Datatype ()};
194
195
const uint8_t * buf{nullptr };
195
196
size_t byte_size{0 };
196
- std::string data_type{request_input->Datatype ()};
197
197
request_input->RawData (&buf, &byte_size);
198
198
199
199
// The first 4 bytes of BYTES data is a 32-bit integer to indicate the size
@@ -213,17 +213,20 @@ InferContext::GetOutputs(const cb::InferResult& infer_result)
213
213
{
214
214
RequestRecord::ResponseOutput output{};
215
215
for (const auto & requested_output : infer_data_.outputs_ ) {
216
+ std::string data_type{requested_output->Datatype ()};
216
217
const uint8_t * buf{nullptr };
217
218
size_t byte_size{0 };
218
219
infer_result.RawData (requested_output->Name (), &buf, &byte_size);
220
+
219
221
// The first 4 bytes of BYTES data is a 32-bit integer to indicate the size
220
222
// of the rest of the data (which we already know based on byte_size). It
221
223
// should be ignored here, as it isn't part of the actual response
222
- if (requested_output-> Datatype () == " BYTES" && byte_size >= 4 ) {
224
+ if (data_type == " BYTES" && byte_size >= 4 ) {
223
225
buf += 4 ;
224
226
byte_size -= 4 ;
225
227
}
226
- output.emplace (requested_output->Name (), ResponseData (buf, byte_size));
228
+ output.emplace (
229
+ requested_output->Name (), RecordData (buf, byte_size, data_type));
227
230
}
228
231
return output;
229
232
}
0 commit comments