import torch
import torch.nn as nn
import torch.nn.functional as F

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

class Esh(nn.Module):
    """
    ESH: A Non-Monotonic Activation Function For Image Classification
    https://ieeexplore.ieee.org/document/10170022
    Esh Activation: f(x) = x * tanh(sigmoid(x))
    """
    def __init__(self):
        super(Esh, self).__init__()

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

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

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

def get_init_inputs():
    return []