All problems
Winograd Transform Lite
Problem
Apply the F(2,3) Winograd input transform to a 4-element tile: B^T d with rows computed as d0 - d2, d1 + d2, -d1 + d2, d1 - d3.
The signature is winograd_transform_1d(d). Return the transformed 4-vector.
Hint
Winograd turns 3x3 convolutions into cheap element-wise multiplies in the transform domain.
Test cases
case 1
in: [[1,2,3,4]]
expected: [-2,5,1,-2]
case 2
in: [[0,0,0,0]]
expected: [0,0,0,0]
case 3
in: [[2,1,0,1]]
expected: [2,1,-1,0]
case 4
in: [[1,1,1,1]]
expected: [0,2,0,0]
Starter codePython
def winograd_transform_1d(d):
# Your code here
pass4 test cases · run your code against them in the editor