Support nonsquare input