paddlets.metrics.utils

ensure_2d(func) Callable[[...], float][source]

A decorator, used for ensuring that the parameter of the wrapped function is a 2-dimentional tensor so that it fits sklearn.metrics.

Parameters

func (Callable[..., float]) – Core function.

Returns

Wrapped core function.

Return type

Callable[…, float]