Comparator

Module: polygraphy.tools.args

class ComparatorRunArgs[source]

Bases: polygraphy.tools.args.base.BaseArgs

Comparator Inference: running inference via Comparator.run().

Depends on:

  • DataLoaderArgs

parse_impl(args)[source]

Parses command-line arguments and populates the following attributes:

warm_up

The number of warm-up runs to perform.

Type

int

use_subprocess

Whether to run each runner in a subprocess.

Type

bool

save_inputs_path

The path at which to save input data.

Type

str

save_outputs_path

The path at which to save output data.

Type

str

class ComparatorCompareArgs(allow_postprocessing: bool = None)[source]

Bases: polygraphy.tools.args.base.BaseArgs

Comparator Comparisons: inference output comparisons.

Depends on:

  • CompareFuncSimpleArgs

  • CompareFuncIndicesArgs

  • RunnerSelectArgs

  • ComparatorPostprocessArgs: if allow_postprocessing == True

Parameters

allow_postprocessing (bool) – Whether to post-processing of outputs before comparison. Defaults to True.

parse_impl(args)[source]

Parses command-line arguments and populates the following attributes:

validate

Whether to run output validation.

Type

bool

load_outputs_paths

Path(s) from which to load outputs.

Type

List[str]

fail_fast

Whether to fail fast.

Type

bool

compare_func

The name of the comparison function to use.

Type

str

compare_func_script

Path to a script defining a custom comparison function.

Type

str

compare_func_name

The name of the function in the script that runs comparison.

Type

str

add_to_script_impl(script, results_name)[source]
Parameters

results_name (str) – The name of the variable containing results from Comparator.run().

Returns

The name of the variable containing the status of Comparator.compare_accuracy().

Return type

str