Loss Methods and Attributes¶ Bases: Module Methods: Name Description forward to Source code in torchebm/core/losses.py 7 8 9 10 11 12 13 14 15 16 17class Loss(nn.Module): def __init__(self): super().__init__() @abstractmethod def forward(self, x: torch.Tensor, *args, **kwargs) -> torch.Tensor: pass def to(self, device): self.device = device return self forward abstractmethod ¶ forward(x: Tensor, *args, **kwargs) -> torch.Tensor Source code in torchebm/core/losses.py 11 12 13@abstractmethod def forward(self, x: torch.Tensor, *args, **kwargs) -> torch.Tensor: pass to ¶ to(device) Source code in torchebm/core/losses.py 15 16 17def to(self, device): self.device = device return self