import torch
import torch.nn as nn

BATCH_SIZE = 512
CHANNELS = 256
L_IN = 1024
NORM_POWER = 2
KERNEL_SIZE = 3
STRIDE = 1

class Model(nn.Module):
    def __init__(self, norm_power, kernel_size, stride):
        super(Model, self).__init__()
        self.pool = nn.LPPool1d(norm_type=norm_power, kernel_size=kernel_size, stride=stride)
    
    def forward(self, input_tensor: torch.Tensor) -> torch.Tensor:
        return self.pool(input_tensor)

def get_inputs():
    """
    生成用于测试的输入张量。
    """
    # LPPool 对负值敏感，使用正值以保证与 powf 的行为一致
    input_tensor = torch.rand(BATCH_SIZE, CHANNELS, L_IN, dtype=torch.float32) + 0.1
    return [input_tensor.contiguous()]

def get_init_inputs():
    return [NORM_POWER, KERNEL_SIZE, STRIDE]