import torch
import torch.nn as nn

class Model(nn.Module):
    def __init__(self):
        super().__init__()
        self.loss = nn.KLDivLoss(reduction='mean', log_target=False)

    def forward(self, x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
        return self.loss(x, y)

batch_size = 1024
feature_dim = 512

def get_inputs():
    x = torch.randn(batch_size, feature_dim, dtype=torch.float32)
    x = torch.nn.functional.log_softmax(x, dim=1) # KLDiv expects log-probs
    y = torch.randn(batch_size, feature_dim, dtype=torch.float32)
    y = torch.nn.functional.softmax(y, dim=1)     # KLDiv expects probs
    return [x, y]

def get_init_inputs():
    return []