25
25
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
26
27
27
#include < stdint.h>
28
+
28
29
#include < exception>
29
30
30
31
#include " libtorch_utils.h"
@@ -232,7 +233,9 @@ ModelState::ModelState(TRITONBACKEND_Model* triton_model)
232
233
enable_weight_sharing_(false ), enable_tensor_fuser_pair_({false , true }),
233
234
enable_jit_profiling_pair_({false , true }),
234
235
enable_jit_executor_pair_({false , true }),
235
- enable_nvfuser_pair_({false , false }) {}
236
+ enable_nvfuser_pair_({false , false })
237
+ {
238
+ }
236
239
237
240
TRITONSERVER_Error*
238
241
ModelState::LoadModel (
@@ -995,7 +998,7 @@ ModelInstanceState::ValidateInputs(const size_t expected_input_cnt)
995
998
TRITONSERVER_ERROR_INTERNAL,
996
999
(" Triton only supports 1 dimensional List of String as input "
997
1000
" for "
998
- " '" +
1001
+ " '" +
999
1002
std::string (state_name) + " ' for model '" +
1000
1003
model_state_->Name () + " '" )
1001
1004
.c_str ());
@@ -1133,7 +1136,7 @@ ModelInstanceState::ValidateOutputs()
1133
1136
TRITONSERVER_ERROR_INTERNAL,
1134
1137
(" Triton only supports 1 dimensional List of String as output "
1135
1138
" for "
1136
- " '" +
1139
+ " '" +
1137
1140
std::string (state_name) + " ' for model '" +
1138
1141
model_state_->Name () + " '" )
1139
1142
.c_str ());
@@ -1668,7 +1671,7 @@ ModelInstanceState::GetNamingConvention(
1668
1671
(" PyTorch model '" + model_state_->Name () +
1669
1672
" ' is using sequence batching with state but state '" +
1670
1673
state_name +
1671
- " ' does not follow the <name>__<index> naming convention. " )
1674
+ " ' does not follow the <name>__<index> naming convention. " )
1672
1675
.c_str ());
1673
1676
} else {
1674
1677
// check if the index part of the name is not an integer
@@ -1680,13 +1683,13 @@ ModelInstanceState::GetNamingConvention(
1680
1683
}
1681
1684
}
1682
1685
if (!is_int) {
1683
- return TRITONSERVER_ErrorNew (
1684
- TRITONSERVER_ERROR_INVALID_ARG,
1685
- (" PyTorch model '" + model_state_->Name () +
1686
+ return TRITONSERVER_ErrorNew (
1687
+ TRITONSERVER_ERROR_INVALID_ARG,
1688
+ (" PyTorch model '" + model_state_->Name () +
1686
1689
" ' is using sequence batching with state but state '" +
1687
1690
state_name +
1688
- " ' does not follow the <name>__<index> naming convention. " )
1689
- .c_str ());
1691
+ " ' does not follow the <name>__<index> naming convention. " )
1692
+ .c_str ());
1690
1693
}
1691
1694
}
1692
1695
}
@@ -2202,21 +2205,21 @@ ModelInstanceState::ReadOutputTensors(
2202
2205
" ' is a scalar which is not supported." )
2203
2206
.c_str ());
2204
2207
}
2205
- if (output_tensor_pair.first != -1 ) {
2208
+ if (output_tensor_pair.first != -1 ) {
2206
2209
responder.ProcessTensor (
2207
2210
name, output_dtype, batchn_shape, output_buffer, memory_type,
2208
2211
memory_id);
2209
- }
2210
- if (output_tensor_pair.second != -1 ) {
2211
- std::vector<TRITONBACKEND_State*> states;
2212
- states = responder.ProcessStateTensor (
2212
+ }
2213
+ if (output_tensor_pair.second != -1 ) {
2214
+ std::vector<TRITONBACKEND_State*> states;
2215
+ states = responder.ProcessStateTensor (
2213
2216
name, output_dtype, batchn_shape, output_buffer, memory_type,
2214
2217
memory_id);
2215
- // Update the states
2216
- for (auto & state : states) {
2217
- RETURN_IF_ERROR (TRITONBACKEND_StateUpdate (state));
2218
+ // Update the states
2219
+ for (auto & state : states) {
2220
+ RETURN_IF_ERROR (TRITONBACKEND_StateUpdate (state));
2221
+ }
2218
2222
}
2219
- }
2220
2223
2221
2224
} else {
2222
2225
responder.ProcessBatchOutput (
@@ -2251,9 +2254,9 @@ ModelInstanceState::ReadOutputTensors(
2251
2254
TRITONBACKEND_Output* response_output;
2252
2255
RESPOND_AND_SET_NULL_IF_ERROR (
2253
2256
&response, TRITONBACKEND_ResponseOutput (
2254
- response, &response_output, name.c_str (),
2255
- TRITONSERVER_TYPE_BYTES, batchn_shape.data (),
2256
- batchn_shape.size ()));
2257
+ response, &response_output, name.c_str (),
2258
+ TRITONSERVER_TYPE_BYTES, batchn_shape.data (),
2259
+ batchn_shape.size ()));
2257
2260
string_buffer.emplace_back (new std::string ());
2258
2261
cuda_copy |= SetStringOutputBuffer (
2259
2262
&output_list, &response, response_output, tensor_element_cnt,
0 commit comments