File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
pytorch_lightning/metrics/functional Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1313# limitations under the License.
1414
1515import torch
16- from torchmetrics .functional .regression .mean_relative_error import mean_relative_error as _mean_relative_error
16+
17+ try : # legacy code
18+ from torchmetrics .functional .regression .mean_relative_error import mean_relative_error as _mape
19+ except ImportError :
20+ from torchmetrics .functional .regression import mean_absolute_percentage_error as _mape
1721
1822from pytorch_lightning .metrics .utils import deprecated_metrics , void
1923
2024
21- @deprecated_metrics (target = _mean_relative_error )
25+ @deprecated_metrics (target = _mape )
2226def mean_relative_error (preds : torch .Tensor , target : torch .Tensor ) -> torch .Tensor :
2327 """
2428 .. deprecated::
You can’t perform that action at this time.
0 commit comments