import torch.nn.functional as F loss_func = [F.cross_entropy](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.cross_entropy.html#torch.nn.functional.cross_entropy "torch.nn.functional.cross_entropy") def model([xb](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor "torch.Tensor")): return [xb](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor "torch.Tensor") @ [weights](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor "torch.Tensor") + [bias](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor "torch.Tensor")