Comparison Functions

Module: polygraphy.tools.args

class CompareFuncSimpleArgs[source]

Bases: BaseArgs

Comparison Function: simple: the CompareFunc.simple comparison function.

Depends on:

  • ComparatorCompareArgs

parse_impl(args)[source]

Parses command-line arguments and populates the following attributes:

rtol

Per-tensor relative tolerance.

Type:

Dict[str, float]

atol

Per-tensor absolute tolerance.

Type:

Dict[str, float]

check_error_stat

The error metric to check.

Type:

str

infinities_compare_equal

Whether to allow +-inf to compare as equal.

Type:

bool

save_heatmaps

Directory in which to save heatmaps of error.

Type:

str

show_heatmaps

Whether to display heatmaps of error.

Type:

bool

save_error_metrics_plot

Path to store generated error plots.

Type:

str

show_error_metrics_plot

Whether to display the error metrics plots.

Type:

bool

error_quantile

Per-tensor quantile of error to compute.

Type:

Dict[str, float]

class CompareFuncIndicesArgs[source]

Bases: BaseArgs

Comparison Function: indices: the CompareFunc.indices comparison function.

Depends on:

  • ComparatorCompareArgs

parse_impl(args)[source]

Parses command-line arguments and populates the following attributes:

index_tolerance

Per-tensor index tolerance.

Type:

Dict[str, int]

class CompareFuncDistanceMetricsArgs[source]

Bases: BaseArgs

Comparison Function: distance_metrics: the CompareFunc.distance_metrics comparison function.

Depends on:

  • ComparatorCompareArgs

parse_impl(args)[source]

Parses command-line arguments and populates the following attributes:

l2_tolerance

Per-tensor L2 norm tolerance.

Type:

Dict[str, float]

cosine_similarity_threshold

Per-tensor cosine similarity thresholds.

Type:

Dict[str, float]

class CompareFuncQualityMetricsArgs[source]

Bases: BaseArgs

Comparison Function: quality_metrics: the CompareFunc.quality_metrics comparison function.

Depends on:

  • ComparatorCompareArgs

parse_impl(args)[source]

Parses command-line arguments and populates the following attributes:

psnr_tolerance

Per-tensor PSNR tolerance.

Type:

Dict[str, float]

snr_tolerance

Per-tensor SNR tolerance.

Type:

Dict[str, float]

class CompareFuncPerceptualMetricsArgs[source]

Bases: BaseArgs

Comparison Function: perceptual_metrics: the CompareFunc.perceptual_metrics comparison function.

Depends on:

  • ComparatorCompareArgs

parse_impl(args)[source]

Parses command-line arguments and populates the following attributes:

lpips_threshold

Per-tensor LPIPS thresholds.

Type:

Dict[str, float]