Add a `DynamoFrameType` type above Python frame object (#140330)
Summary:
This patch introduces a `DynamoFrameType` to serve as a layer between
Dynamo and different versions of Python frame object. In
`DynamoFrameType`, we only register attributes Dynamo cares about (e.g.,
`f_code`, `f_locals`, etc.
This will be helpful when it comes to adding new attributes to this
`DynamoFrameType`, or dealing with Python version changes.
X-link: https://github.com/pytorch/pytorch/pull/140330
Approved by: https://github.com/jansel, https://github.com/williamwen42
Reviewed By: kit1980
Differential Revision: D66015860
Pulled By: StrongerXi
fbshipit-source-id: 267dce32ac6c9b5effec6d8ac974d812f7053314