move some methods into function.cpp (#25119)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25119
Make `defaultSchemaFor` an anonymous function and move it + its caller
into function.cpp
Purely mechanical changes
Test Plan: Imported from OSS
Differential Revision: D16994147
Pulled By: suo
fbshipit-source-id: 96da8b3527eea37ad7beae433122384303a010c9