I want to optimize this 6-nested for loop convolution I consider to transform convolution to matrix multiplication (reference : https://medium.com/@_init_/an-illustrated-exp