Skip to content

Fix build failure #555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/c++/perf_analyzer/infer_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ InferContext::GetInputs()
{
RequestRecord::RequestInput input{};
for (const auto& request_input : infer_data_.valid_inputs_) {
std::string data_type{request_input->Datatype()};
const uint8_t* buf{nullptr};
size_t byte_size{0};
std::string data_type{request_input->Datatype()};
request_input->RawData(&buf, &byte_size);

// The first 4 bytes of BYTES data is a 32-bit integer to indicate the size
Expand All @@ -213,17 +213,20 @@ InferContext::GetOutputs(const cb::InferResult& infer_result)
{
RequestRecord::ResponseOutput output{};
for (const auto& requested_output : infer_data_.outputs_) {
std::string data_type{requested_output->Datatype()};
const uint8_t* buf{nullptr};
size_t byte_size{0};
infer_result.RawData(requested_output->Name(), &buf, &byte_size);

// The first 4 bytes of BYTES data is a 32-bit integer to indicate the size
// of the rest of the data (which we already know based on byte_size). It
// should be ignored here, as it isn't part of the actual response
if (requested_output->Datatype() == "BYTES" && byte_size >= 4) {
if (data_type == "BYTES" && byte_size >= 4) {
buf += 4;
byte_size -= 4;
}
output.emplace(requested_output->Name(), ResponseData(buf, byte_size));
output.emplace(
requested_output->Name(), RecordData(buf, byte_size, data_type));
}
return output;
}
Expand Down
Loading