I’m not sure I understand the use case correctly, but your operation doesn’t seem to contain trainable parameters.
You could create the input tensor and just call x**2 to get the output:
x = torch.linspace(-10, 10, 21)
y = x**2

However, since no parameter is used, this won’t be trainable.