Class InferContext::Options

Nested Relationships

This class is a nested type of Class InferContext.

Class Documentation

class Options

Run options to be applied to all subsequent Run() invocations.

Public Functions

virtual ~Options()
virtual size_t BatchSize() const = 0

Return
The batch size to use for all subsequent inferences.

virtual void SetBatchSize(size_t batch_size) = 0

Set the batch size to use for all subsequent inferences.

Parameters
  • batch_size: The batch size.

virtual Error AddRawResult(const std::shared_ptr<InferContext::Output> &output) = 0

Add ‘output’ to the list of requested RAW results.

Run() will return the output’s full tensor as a result.

Return
Error object indicating success or failure.
Parameters
  • output: The output.

virtual Error AddClassResult(const std::shared_ptr<InferContext::Output> &output, uint64_t k) = 0

Add ‘output’ to the list of requested CLASS results.

Run() will return the highest ‘k’ values of ‘output’ as a result.

Return
Error object indicating success or failure.
Parameters
  • output: The output.
  • k: Set how many class results to return for the output.

Public Static Functions

static Error Create(std::unique_ptr<Options> *options)

Create a new Options object with default values.

Return
Error object indicating success or failure.