viable/strict/1788202219: [AOTInductor] Fix user-managed constant handle leak (#194480) (#194480)
- PyTorch: 315 events in the last 90 days
- PyTorch: 312th Release in the last 90 days
- Previous: earlier the same day · viable/strict/1788197050: Move partial XPU device property utils to aten (#195146)
What happened
Summary: MaybeOwningAtenTensorHandle created a shallow tensor handle for user-managed constants without owning it, leaking the allocated tensor wrapper and its reference to the underlying storage. Store every ConstantMap entry in RAIIAtenTensorHandle . For user-managed constants, create a checked shallow handle copy and immediately transfer ownership to the map. This preserves zero-copy tensor data and caller owners…
Summary assembled by rule from the sources below