Publish torch::Dict and torch::OperatorKernel (#20723)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20723
These classes already existed but only as c10::Dict and c10::OperatorKernel.
Since they're now part of torch::RegisterOperators(), they should also live in the torch namespace.
Differential Revision: D15421575
fbshipit-source-id: d64ebd8664fadc264bbbae7eca1faa182529a32b
diff --git a/aten/src/ATen/core/Dict.h b/aten/src/ATen/core/Dict.h
index 3a3d920..3d08d93 100644
--- a/aten/src/ATen/core/Dict.h
+++ b/aten/src/ATen/core/Dict.h
@@ -355,4 +355,8 @@
}
+namespace torch {
+ template<class Key, class Value> using DictPtr = c10::DictPtr<Key, Value>;
+}
+
#include <ATen/core/Dict_inl.h>
diff --git a/aten/src/ATen/core/List.h b/aten/src/ATen/core/List.h
index af024de..6a998bf 100644
--- a/aten/src/ATen/core/List.h
+++ b/aten/src/ATen/core/List.h
@@ -462,4 +462,8 @@
}
+namespace torch {
+ template<class T> using ListPtr = c10::ListPtr<T>;
+}
+
#include <ATen/core/List_inl.h>
diff --git a/aten/src/ATen/core/op_registration/kernel_functor.h b/aten/src/ATen/core/op_registration/kernel_functor.h
index 30879df..879ed06 100644
--- a/aten/src/ATen/core/op_registration/kernel_functor.h
+++ b/aten/src/ATen/core/op_registration/kernel_functor.h
@@ -314,3 +314,7 @@
}
}
+
+namespace torch {
+ using OperatorKernel = c10::OperatorKernel;
+}
diff --git a/aten/src/ATen/core/op_registration/op_registration.h b/aten/src/ATen/core/op_registration/op_registration.h
index ca28afd..245d63b 100644
--- a/aten/src/ATen/core/op_registration/op_registration.h
+++ b/aten/src/ATen/core/op_registration/op_registration.h
@@ -418,3 +418,7 @@
};
}
+
+namespace torch {
+ using RegisterOperators = c10::RegisterOperators;
+}
diff --git a/torch/csrc/jit/custom_operator.h b/torch/csrc/jit/custom_operator.h
index 482451a..47929c7 100644
--- a/torch/csrc/jit/custom_operator.h
+++ b/torch/csrc/jit/custom_operator.h
@@ -48,6 +48,4 @@
} // namespace jit
-using RegisterOperators = c10::RegisterOperators;
-
} // namespace torch