codegen: Improve array default handing (#45163)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/45163
Test Plan: Imported from OSS
Reviewed By: ngimel
Differential Revision: D24132279
Pulled By: mruberry
fbshipit-source-id: 77069e7526b35cf8d13ba448e313c90f20cc67cf