Skip to content

Commit

Permalink
Mark response parameters accessor const and JSON serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
kthui committed Jan 24, 2025
1 parent 816d4ac commit f231147
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/infer_response.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ InferResponse::OutputTensors()
return output_tensors_;
}

std::string&
InferResponse::Parameters()
const std::string&
InferResponse::Parameters() const
{
return parameters_;
}
Expand Down
2 changes: 1 addition & 1 deletion src/infer_response.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class InferResponse {
std::shared_ptr<PbError> error = nullptr, std::string parameters = "",
const bool is_last_response = true, void* id = nullptr);
std::vector<std::shared_ptr<PbTensor>>& OutputTensors();
std::string& Parameters();
const std::string& Parameters() const; // JSON serializable unless empty
void SaveToSharedMemory(
std::unique_ptr<SharedMemoryManager>& shm_pool, bool copy_gpu = true);
static std::unique_ptr<InferResponse> LoadFromSharedMemory(
Expand Down

0 comments on commit f231147

Please sign in to comment.