New opt: T.dot(A,B)[i] -> T.dot(A[i],B)

This is partial implementation of gh-2151
`pad_dim` is unused. Did you want to do something with it?