Skip to content

Commit

Permalink
Assert on json input format
Browse files Browse the repository at this point in the history
  • Loading branch information
tgerdesnv committed Mar 5, 2024
1 parent 20cc90b commit 0e06c11
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/c++/perf_analyzer/perf_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,13 @@ SerializeExplicitTensor(
} else if (dt.compare("JSON") == 0) {
std::string serialized = "";

for (const auto& value : tensor.GetArray()) {
auto values = tensor.GetArray();
if (values.Size() != 1) {
return cb::Error(
"JSON format does not yet support multiple json objects in the "
"input");
}
for (const auto& value : values) {
rapidjson::StringBuffer buffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
value.Accept(writer);
Expand Down

0 comments on commit 0e06c11

Please sign in to comment.