ENH: Define specific dimension sizes as enums instead of variables

Avoids warnings for variables only used as template arguments.

Change-Id: I2338f070a38ad81699e50903c80014c554240d94