|
38 | 38 | #include "triton/backend/backend_output_responder.h"
|
39 | 39 | #include "triton/common/nvtx.h"
|
40 | 40 | #include "triton/core/tritonbackend.h"
|
41 |
| -#include "triton/core/tritonserver.h" |
42 | 41 |
|
43 | 42 | #ifdef TRITON_PYTORCH_ENABLE_TORCHVISION
|
44 | 43 | // Suppress warnings in torch headers
|
@@ -154,7 +153,9 @@ class ModelState : public BackendModel {
|
154 | 153 | torch_models_;
|
155 | 154 |
|
156 | 155 | // 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 |
158 | 159 | // can have intersection with the outputs section of the model. If an output
|
159 | 160 | // is specified both in the output section and state section, it indicates
|
160 | 161 | // that the backend must return the output state to the client too.
|
@@ -548,11 +549,6 @@ class ModelInstanceState : public BackendModelInstance {
|
548 | 549 | TRITONSERVER_Error* ValidateTypedSequenceControl(
|
549 | 550 | triton::common::TritonJson::Value& sequence_batching,
|
550 | 551 | 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); |
556 | 552 | TRITONSERVER_Error* ValidateInputs(const size_t expected_input_cnt);
|
557 | 553 | void AddInputToMap(
|
558 | 554 | NamingConvention naming_convention,
|
@@ -882,8 +878,6 @@ ModelInstanceState::ValidateTypedSequenceControl(
|
882 | 878 |
|
883 | 879 | return nullptr; // success
|
884 | 880 | }
|
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 = "__"; |
887 | 881 |
|
888 | 882 | void
|
889 | 883 | ModelInstanceState::AddInputToMap(
|
@@ -1065,7 +1059,6 @@ ModelInstanceState::ValidateInputs(const size_t expected_input_cnt)
|
1065 | 1059 | .c_str());
|
1066 | 1060 | }
|
1067 | 1061 |
|
1068 |
| - |
1069 | 1062 | // Validate shape for String inputs. Only allow 1 dimension.
|
1070 | 1063 | if (state_dtype == "TYPE_STRING") {
|
1071 | 1064 | std::vector<int64_t> dims;
|
@@ -1212,7 +1205,7 @@ ModelInstanceState::ValidateOutputs()
|
1212 | 1205 | TRITONSERVER_ERROR_INTERNAL,
|
1213 | 1206 | ("Triton only supports 1 dimensional List of String as output "
|
1214 | 1207 | "for "
|
1215 |
| - "'" + |
| 1208 | + "'" + |
1216 | 1209 | std::string(state_name) + "' for model '" +
|
1217 | 1210 | model_state_->Name() + "'")
|
1218 | 1211 | .c_str());
|
@@ -2333,11 +2326,11 @@ ModelInstanceState::ReadOutputTensors(
|
2333 | 2326 | states = responder.ProcessStateTensor(
|
2334 | 2327 | name, output_dtype, batchn_shape, output_buffer, memory_type,
|
2335 | 2328 | 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 | + } |
2339 | 2333 | }
|
2340 |
| - } |
2341 | 2334 |
|
2342 | 2335 | } else {
|
2343 | 2336 | responder.ProcessBatchOutput(
|
|
0 commit comments