Formatting
* Adding black as dev dependency * Formatting pina code * Formatting tests
This commit is contained in:
committed by
Nicola Demo
parent
4c4482b155
commit
42ab1a666b
@@ -1,10 +1,11 @@
|
||||
""" Module for LpLoss class """
|
||||
"""Module for LpLoss class"""
|
||||
|
||||
import torch
|
||||
|
||||
from ..utils import check_consistency
|
||||
from .loss_interface import LossInterface
|
||||
|
||||
|
||||
class LpLoss(LossInterface):
|
||||
r"""
|
||||
The Lp loss implementation class. Creates a criterion that measures
|
||||
@@ -75,4 +76,4 @@ class LpLoss(LossInterface):
|
||||
loss = torch.linalg.norm((input - target), ord=self.p, dim=-1)
|
||||
if self.relative:
|
||||
loss = loss / torch.linalg.norm(input, ord=self.p, dim=-1)
|
||||
return self._reduction(loss)
|
||||
return self._reduction(loss)
|
||||
|
||||
Reference in New Issue
Block a user