import torch
import torch.nn as nn


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

    def forward(self, x):
        # Interpret input [N, 2] as complex Z = X + iY
        z = torch.complex(x[..., 0], x[..., 1])

        # Calculate Magnitude |Z|
        return torch.abs(z)


batch_size = 1024
dim = 2


def get_inputs():
    x = torch.randn(batch_size, dim)
    return [x]


def get_init_inputs():
    return []