Added "dump ops" API to return ops instead of print (#78995)
Useful to use for grabbing info instead of the hacky "redirect C++ output" stuff I currently do.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78995
Approved by: https://github.com/ezyang