xnn.common.benchmark.metrics.load_custom_metric#
- xnn.common.benchmark.metrics.load_custom_metric(name, path)[source]#
Import a
module:functioncallable and register it undername.Lets a benchmark config pull in user-defined metrics without any code changes to xnn: give the dotted import path of a callable with the
(pred, target) -> floatsignature (seeMetric).- Parameters:
- Returns:
The imported (and now registered) callable.
- Return type:
Metric
- Raises:
ValueError – If
pathdoes not contain themodule:functionseparator.