base.metrics.error_bm module

class base.metrics.error_bm.BitMaskError(max_value, step)

Bases: circa.base.metrics.error_metric.ErrorMetric

ErrorMetric subclass that represents an error as a number of MSBs and a number of LSBs that together form a bit mask specifying which bits should be replaced with zeros during approximation. Error values are tuples (num_msbs, num_lsbs).

static metricId()

Returns this ErrorMetric’s unique ID string.

getNextValues(cur_value)

Returns a list of all possible values resulting from increasing cur_value by one step.

getPrevValues(cur_value)

Returns a list of all possible values from which cur_value can be reached in one step. The list is empty if this is not possible.

getValueStr(value)

Returns a human-readable string representation of the given value.

greaterMax(value)

Returns True if value exceeds max_value, else False.

convertToValue(value)

Converts the given string representation of a value into the correct value type.