import torch
import torch.nn as nn

BATCH_SIZE = 4096
DIM = 4096
SHAPE = (BATCH_SIZE, DIM)

class LiSHT(nn.Module):
    """
    公式: f(x) = x * tanh(x)
    """
    def __init__(self):
        super(LiSHT, self).__init__()

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

class Model(nn.Module):
    def __init__(self):
        super(Model, self).__init__()
        self.lisht = LiSHT()
    
    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return self.lisht(x)

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

def get_init_inputs():
    return []