import torch
import torch.nn as nn

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

    def forward(self, x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
        intersection = (x * y).sum(dim=1)
        sum_x = x.sum(dim=1)
        sum_y = y.sum(dim=1)
        return (2.0 * intersection) / (sum_x + sum_y + self.eps)

batch_size = 128
feature_dim = 512

def get_inputs():
    x = torch.rand(batch_size, feature_dim, dtype=torch.float32)
    y = torch.rand(batch_size, feature_dim, dtype=torch.float32)
    return [x, y]

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