mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Add DictType to Metadata (#20770)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/20770 Add dict type since it's part of the pytorch built-in system, and sparse features and text features will be converted to Dict Reviewed By: pritamdamania87 Differential Revision: D15436255 fbshipit-source-id: 239adbd6a8f68be29020fe656d790f6872f1f0e9
This commit is contained in:
committed by
Facebook Github Bot
parent
70eb315da4
commit
c2d0e7316f
@ -681,7 +681,9 @@ void initPythonIRBindings(PyObject* module_) {
|
||||
py::class_<DictType, Type, std::shared_ptr<DictType>>(m, "DictType")
|
||||
.def(py::init([](TypePtr key, TypePtr value) {
|
||||
return DictType::create(key, value);
|
||||
}));
|
||||
}))
|
||||
.def("getKeyType", &DictType::getKeyType)
|
||||
.def("getValueType", &DictType::getValueType);
|
||||
py::class_<OptionalType, Type, std::shared_ptr<OptionalType>>(
|
||||
m, "OptionalType")
|
||||
.def(py::init([](TypePtr a) { return OptionalType::create(a); }))
|
||||
|
Reference in New Issue
Block a user