import torch
import torch.nn as nn

class Model(nn.Module):
    def __init__(self, eps=1e-8):
        super(Model, self).__init__()
        self.eps = eps

    def forward(self, input, target):
        ratio = target / (input + self.eps)
        loss = ratio - torch.log(ratio + self.eps) - 1.0
        return loss.mean()

batch_size = 32
input_dim = 1024

def get_inputs():
    input = torch.abs(torch.randn(batch_size, input_dim, requires_grad=True)) + 0.1
    target = torch.abs(torch.randn(batch_size, input_dim)) + 0.1
    return [input, target]

def get_init_inputs():
    return [1e-8]