Skip to content

Commit d1035dc

Browse files
jamied157Tabrizian
authored andcommitted
MR comments
1 parent 70cb673 commit d1035dc

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/libtorch.cc

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#include "triton/backend/backend_output_responder.h"
3939
#include "triton/common/nvtx.h"
4040
#include "triton/core/tritonbackend.h"
41-
#include "triton/core/tritonserver.h"
4241

4342
#ifdef TRITON_PYTORCH_ENABLE_TORCHVISION
4443
// Suppress warnings in torch headers
@@ -154,7 +153,9 @@ class ModelState : public BackendModel {
154153
torch_models_;
155154

156155
// model_outputs is a map that contains unique outputs that the model must
157-
// provide. In the model configuration, the output in the state configuration
156+
// provide. The first pair is the model output index and the second is
157+
// the index in the model state, -1 is used if one is not required.
158+
// In the model configuration, the output in the state configuration
158159
// can have intersection with the outputs section of the model. If an output
159160
// is specified both in the output section and state section, it indicates
160161
// that the backend must return the output state to the client too.
@@ -548,11 +549,6 @@ class ModelInstanceState : public BackendModelInstance {
548549
TRITONSERVER_Error* ValidateTypedSequenceControl(
549550
triton::common::TritonJson::Value& sequence_batching,
550551
const std::string& control_kind, bool required, bool* have_control);
551-
void AddInputToMap(
552-
NamingConvention naming_convention,
553-
const std::vector<std::string> allowed_inputs,
554-
const std::string &io_name,
555-
const uint32_t index);
556552
TRITONSERVER_Error* ValidateInputs(const size_t expected_input_cnt);
557553
void AddInputToMap(
558554
NamingConvention naming_convention,
@@ -882,8 +878,6 @@ ModelInstanceState::ValidateTypedSequenceControl(
882878

883879
return nullptr; // success
884880
}
885-
void ModelInstanceState::AddInputToMap(NamingConvention naming_convention, const std::vector<std::string> allowed_inputs, const std::string &io_name, const uint32_t index) {
886-
std::string deliminator = "__";
887881

888882
void
889883
ModelInstanceState::AddInputToMap(
@@ -1065,7 +1059,6 @@ ModelInstanceState::ValidateInputs(const size_t expected_input_cnt)
10651059
.c_str());
10661060
}
10671061

1068-
10691062
// Validate shape for String inputs. Only allow 1 dimension.
10701063
if (state_dtype == "TYPE_STRING") {
10711064
std::vector<int64_t> dims;
@@ -1212,7 +1205,7 @@ ModelInstanceState::ValidateOutputs()
12121205
TRITONSERVER_ERROR_INTERNAL,
12131206
("Triton only supports 1 dimensional List of String as output "
12141207
"for "
1215-
"'" +
1208+
"'" +
12161209
std::string(state_name) + "' for model '" +
12171210
model_state_->Name() + "'")
12181211
.c_str());
@@ -2333,11 +2326,11 @@ ModelInstanceState::ReadOutputTensors(
23332326
states = responder.ProcessStateTensor(
23342327
name, output_dtype, batchn_shape, output_buffer, memory_type,
23352328
memory_id);
2336-
// Update the states
2337-
for (auto& state : states) {
2338-
RETURN_IF_ERROR(TRITONBACKEND_StateUpdate(state));
2329+
// Update the states
2330+
for (auto& state : states) {
2331+
RETURN_IF_ERROR(TRITONBACKEND_StateUpdate(state));
2332+
}
23392333
}
2340-
}
23412334

23422335
} else {
23432336
responder.ProcessBatchOutput(

0 commit comments

Comments
 (0)