runner_ext

Functions

std::vector<float> get_input_scale(std::vector<const xir::Tensor*> input_tensors)
std::vector<float> get_output_scale(std::vector<const xir::Tensor*> output_tensors)
float get_input_scale(const xir::Tensor *input_tensor)
float get_output_scale(const xir::Tensor *output_tensor)
namespace vart

Functions

std::vector<float> get_input_scale(std::vector<const xir::Tensor*> input_tensors)
std::vector<float> get_output_scale(std::vector<const xir::Tensor*> output_tensors)
float get_input_scale(const xir::Tensor *input_tensor)
float get_output_scale(const xir::Tensor *output_tensor)
class RunnerExt : public Runner

Public Functions

explicit RunnerExt() = default
RunnerExt(const RunnerExt&) = delete
RunnerExt &operator=(const RunnerExt &other) = delete
virtual ~RunnerExt() = default
virtual std::vector<vart::TensorBuffer*> get_inputs() = 0

Gets all input TensorBuffers of RunnerExt.

Sample code:

auto runner = vart::RunnerExt::create_runner(subgraph, attrs);
auto input_tensor_buffers = runner->get_inputs();
    for (auto input : input_tensor_buffers) {
        auto shape = input->get_tensor()->get_shape();
}
Returns:

All input TensorBuffers. A vector of raw pointer to the input TensorBuffer.

virtual std::vector<vart::TensorBuffer*> get_outputs() = 0

Gets all output TensorBuffers of RunnerExt.

Sample code:

auto runner = vart::RunnerExt::create_runner(subgraph, attrs);
auto output_tensor_buffers = runner->get_outputs();
    for (auto output : output_tensor_buffers) {
        auto shape = output->get_tensor()->get_shape();
}
Returns:

All output TensorBuffers. A vector of raw pointer to the output TensorBuffer.

Public Static Functions

static std::unique_ptr<RunnerExt> create_runner(const xir::Subgraph *subgraph, xir::Attrs *attrs)

Factory fucntion to create an instance of runner by subgraph and attrs.

Parameters:
  • subgraph – XIR Subgraph

  • attrs – XIR attrs object, this object is shared among all runners on the same graph.

Returns:

An instance of runner.