Skip to content

Commit ef98f36

Browse files
authored
Fix a bug (#1936)
A bit uncomfortable not using an initialization list to initialize value_, but can't think of any other way to workaround the c10::variant deprecated problem.
1 parent 63132a0 commit ef98f36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torch/csrc/jit/codegen/cuda/dynamic_type.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class TORCH_CUDA_CU_API IntOrDouble {
2323

2424
// Avoid using copy constructor of c10::variant as it's
2525
// deprecated.
26-
IntOrDouble(const IntOrDouble& other)
27-
: IntOrDouble(other.is_int() ? other.as<int64_t>() : other.as<double>()) {
26+
IntOrDouble(const IntOrDouble& other) {
27+
value_ = other.value_;
2828
}
2929

3030
// Explicitly define copy assignment operator as its implicit definition is

0 commit comments

Comments
 (0)