Remove validation code for 'nx' and 'ny' from function