[PyTorch] Split `libtorch_sources` into smaller filelists (#36583)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/36583
To make them more reusable across different build systems
Move `load()` directive at the head of `build_variables.bzl` inside function that uses them to make `build_variables.bzl` valid standalone python source file
Test Plan: CI + `python -c 'exec(open("tools/build_variables.bzl").read());print(libtorch_sources)'`
Reviewed By: EscapeZero
Differential Revision: D21018974
fbshipit-source-id: 3dbf2551620f164b8910270ad2c5c91125a9f5f0