Allow different input and output dimensions for variables