Function TRITONSERVER_InferenceResponseParameter

Function Documentation

TRITONSERVER_Error *TRITONSERVER_InferenceResponseParameter(TRITONSERVER_InferenceResponse *inference_response, const uint32_t index, const char **name, TRITONSERVER_ParameterType *type, const void **vvalue)

Get all information about a parameter.

The caller does not own any of the returned values and must not modify or delete them. The lifetime of all returned values extends until ‘inference_response’ is deleted.

The ‘vvalue’ returns a void* pointer that must be cast appropriately based on ‘type’. For example:

void* vvalue; TRITONSERVER_ParameterType type; TRITONSERVER_InferenceResponseParameter( response, index, &name, &type, &vvalue); switch (type) { case TRITONSERVER_PARAMETER_BOOL: bool value = *(reinterpret_cast<bool*>(vvalue)); … case TRITONSERVER_PARAMETER_INT: int64_t value = *(reinterpret_cast<int64_t*>(vvalue)); … case TRITONSERVER_PARAMETER_STRING: const char* value = reinterpret_cast<const char*>(vvalue); …

Return

a TRITONSERVER_Error indicating success or failure.

Parameters
  • inference_response: The response object.

  • index: The index of the parameter, must be 0 <= index < count, where ‘count’ is the value returned by TRITONSERVER_InferenceResponseParameterCount.

  • name: Returns the name of the parameter.

  • type: Returns the type of the parameter.

  • vvalue: Returns a pointer to the parameter value.