We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 010f238 commit 28ecc10Copy full SHA for 28ecc10
aten/src/ATen/core/ivalue.h
@@ -495,6 +495,11 @@ struct CAFFE2_API WeakIValue final {
495
std::swap(tag, rhs.tag);
496
}
497
498
+ bool isSameIdentity(const WeakIValue& rhs) const {
499
+ return payload.as_int == rhs.payload.as_int && tag == rhs.tag &&
500
+ is_intrusive_ptr == rhs.is_intrusive_ptr;
501
+ }
502
+
503
IValue lock() const {
504
if (!is_intrusive_ptr) {
505
return IValue(payload, tag, false);
torch/csrc/jit/tracer.h
@@ -75,7 +75,7 @@ struct TORCH_API TracingState
75
76
struct WeakIValueEq {
77
bool operator()(const WeakIValue& t1, const WeakIValue& t2) const {
78
- return t1.lock().isSameIdentity(t2.lock());
+ return t1.isSameIdentity(t2);
79
80
};
81
0 commit comments