import torch
import torch.nn as nn

BATCH_SIZE = 4096
HIDDEN_DIM = 4096
SHAPE = (BATCH_SIZE, HIDDEN_DIM)

class TeLU(nn.Module):
    """
    TeLU Activation: f(x) = x * tanh(exp(x))
    https://arxiv.org/abs/2412.20269
    """
    def __init__(self):
        super(TeLU, self).__init__()

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return x * torch.tanh(torch.exp(x))

class Model(nn.Module):
    def __init__(self):
        super(Model, self).__init__()
        self.act = TeLU()
    
    def forward(self, x):
        return self.act(x)

def get_inputs():
    input_tensor = torch.randn(SHAPE, dtype=torch.float32) * 5.0
    return [input_tensor.contiguous()]

def get_init_inputs():
    return []