Make sure that while caching values we don't invoke any Aten operator (#99050)
Summary:
title
also change catch to catch all so we can make it wont fail
Test Plan: existing tests
Reviewed By: harishs88ss
Differential Revision: D44945942
Pull Request resolved: https://github.com/pytorch/pytorch/pull/99050
Approved by: https://github.com/angelayi