Run inference on a PyTorch model. Given an input tensor and a trained torch.nn.Linear model, compute the forward pass and store the result in the output tensor.
The model performs a linear transformation: output = input @ weight.T + bias where weight has shape [output_size, input_size] and bias has shape [output_size].
solve function signature must remain unchangedoutput tensor
Input: input = [[1.0, 2.0]] (batch_size=1, input_size=2)
model: Linear layer with weight=[[0.5, 1.0], [1.5, 0.5]], bias=[0.1, 0.2]
Output: output = [[2.6, 2.7]] (batch_size=1, output_size=2)
Input: input = [[1.0], [2.0], [3.0]] (batch_size=3, input_size=1)
model: Linear layer with weight=[[2.0]], bias=[1.0]
Output: output = [[3.0], [5.0], [7.0]] (batch_size=3, output_size=1)
batch_size ≤ 1,000input_size ≤ 1,000output_size ≤ 1,000batch_size = 1,000