Solved by ptrblck in post #10 
              
              
                You are using a kernel size of (1, 1, b*b), so the width dimension will be reduced since you are not using any padding. 
The last error is raised, because based on the information you’ve provided, I assumed that n is the depth dimension, which expects a 5D input tensor as given in my previous post.