diff --git a/aten/src/ATen/core/ivalue.h b/aten/src/ATen/core/ivalue.h index 5958ad25dd4735..7831b3ab90be91 100644 --- a/aten/src/ATen/core/ivalue.h +++ b/aten/src/ATen/core/ivalue.h @@ -237,7 +237,6 @@ struct CAFFE2_API IValue final { c10::ArrayRef toTensorListRef() const; //GenericList - IValue(std::vector v); IValue(c10::List v); bool isGenericList() const { return Tag::GenericList == tag; } c10::List toGenericList() &&; diff --git a/aten/src/ATen/core/ivalue_inl.h b/aten/src/ATen/core/ivalue_inl.h index d823bdb4cc1b8d..19cd102369375d 100644 --- a/aten/src/ATen/core/ivalue_inl.h +++ b/aten/src/ATen/core/ivalue_inl.h @@ -593,8 +593,6 @@ inline IValue::IValue(c10::impl::GenericList v) : tag(Tag::GenericList), is_intrusive_ptr(true) { payload.as_intrusive_ptr = v.impl_.release(); } -inline IValue::IValue(std::vector v) -: IValue(c10::impl::toList(std::move(v))) {} template inline IValue::IValue(c10::List v) : IValue(impl::toGenericList(std::move(v))) { @@ -619,7 +617,7 @@ inline IValue::IValue(c10::Dict v) : IValue(impl::toGenericDict(std::move(v))) {} template inline IValue::IValue(std::unordered_map v) -: IValue(impl::GenericDict()) { +: IValue(Dict()) { auto dict = to>(); dict.reserve(v.size()); for (auto& e : v) { diff --git a/test/cpp/api/jit.cpp b/test/cpp/api/jit.cpp index 3ec9db6d004190..09cabc377ebc5e 100644 --- a/test/cpp/api/jit.cpp +++ b/test/cpp/api/jit.cpp @@ -93,7 +93,7 @@ TEST(TorchScriptTest, TestDictArgMatching) { def dict_op(a: Dict[str, Tensor], b: str): return a[b] )JIT"); - c10::impl::GenericDict dict; + c10::Dict dict; dict.insert("hello", torch::ones({2})); auto output = module->run_method("dict_op", dict, std::string("hello")); ASSERT_EQ(1, output.toTensor()[0].item()); diff --git a/torch/csrc/jit/pybind_utils.h b/torch/csrc/jit/pybind_utils.h index 369b69f71fc532..31f4961c89abcf 100644 --- a/torch/csrc/jit/pybind_utils.h +++ b/torch/csrc/jit/pybind_utils.h @@ -305,7 +305,7 @@ inline TypedStack toTypedStack(const py::tuple& inputs) { } inline IValue createGenericList(py::handle obj, const TypePtr& elem_type) { - c10::List elems; + c10::impl::GenericList elems; for (auto elem : obj) { elems.push_back(toIValue(elem, elem_type)); } diff --git a/torch/csrc/jit/register_prim_ops.cpp b/torch/csrc/jit/register_prim_ops.cpp index 53dc8ec49fecb4..e66491cafb5127 100644 --- a/torch/csrc/jit/register_prim_ops.cpp +++ b/torch/csrc/jit/register_prim_ops.cpp @@ -966,7 +966,7 @@ RegisterOperators reg( } else { return [=](Stack& stack) { const size_t stack_size = stack.size(); - c10::List vals; + c10::impl::GenericList vals; vals.reserve(num_inputs); for (size_t i = stack_size - num_inputs; i < stack_size; ++i) { vals.emplace_back(std::move(stack[i]));