Implement the Swish-Gated Linear Unit (SWiGLU) activation function forward pass for 1D input vectors.
Given an input tensor of shape [N] where N is the number of elements, compute the output using the elementwise formula.
The input and output tensor must be of type float32.
SWiGLU is defined as:
solve function signature must remain unchangedoutput tensorInput: [1.0, 2.0, 3.0, 4.0] (N=4) Output: [2.1931758, 7.0463767]
Input: [0.5, 1.0] (N=2) Output: [0.31122968]
N ≤ 100,000N = 100,000