You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Call destructor explicitly when move constructing Value (#3148)
Summary:
Pull Request resolved: #3148
## Context
Inspecting code for ATen and ExecuTorch's `Value` classes (e.g. `IValue` and `EValue` respectively) I noticed that the destructor is called [explicitly when move constructing with non-trivial types](https://github.com/pytorch/pytorch/blob/main/aten/src/ATen/core/ivalue.h#L409). In practice I don't think calling the destructor explicitly is necessary because move constructing typically sets the moved from object to an inactive state, but since we use `Value` to encapsulate STL types (i.e. types for which we do not implement the destructor) it's best to call the destructor explicitly to be safe.
ghstack-source-id: 223225898
exported-using-ghexport
Reviewed By: jorgep31415
Differential Revision: D56357187
fbshipit-source-id: 4797a627efcd2a61ee35d4c6963e524b4161ff3b
0 commit comments