import torch
import torch.nn as nn


class Model(nn.Module):
    def __init__(self, a=1.0):
        super().__init__()
        self.a = a

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        # ISRLU Formula: x if x >= 0, else x / sqrt(1 + a * x^2)
        y_neg = x / torch.sqrt(1.0 + self.a * x.pow(2))

        return torch.where(x >= 0, x, y_neg)


batch_size = 128
feature_dim = 512


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


def get_init_inputs():
    return [1.0]