Take eager tensor caches outside of EagerContext
This CL should have no behavior changes. It moves the tensor caches that were fields of eager Context into a global map indexed by context id. This CL is needed so that eager Context does not have a references to EagerTensors. Future changes will add a reference from EagerTensor to eager Context. This will mimick the ownership structure of corresponding C++ objects and ensure that Python will delete the context only after all the tensors have been deleted. The latter will allow us to simplify EagerContext destruction and remove ref counting from it. PiperOrigin-RevId: 258454245
Showing
想要评论请 注册 或 登录