Skip to content

Commit 0e5b92d

Browse files
mcremon-metafacebook-github-bot
authored andcommitted
Add OptionalIntArrayRef used by torchgen. (pytorch#5735)
Summary: Pull Request resolved: pytorch#5735 Adds OptionalIntArrayRef for generated cpp using torchgen. Generated code with torchgen.api.types.CppSignatureGroup uses additional aliases that are not currently defined in exec_aten.h. This diff adds support for OptionalIntArrayRef. Example: aten::mean.dim uses an optional int array that would end up using `OptionalIntArrayRef`. Reviewed By: zonglinpeng Differential Revision: D63568016 fbshipit-source-id: fc87338632c5d2e84f1dd9b088d69ad304a13d1c
1 parent 70aee72 commit 0e5b92d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

runtime/core/exec_aten/exec_aten.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ using IntArrayRef = at::IntArrayRef;
8787

8888
template <typename T>
8989
using OptionalArrayRef = c10::OptionalArrayRef<T>;
90+
using OptionalIntArrayRef = OptionalArrayRef<int64_t>;
9091

9192
inline ssize_t compute_numel(const SizesType* sizes, ssize_t dim) {
9293
return static_cast<ssize_t>(
@@ -132,6 +133,7 @@ using IntArrayRef = torch::executor::IntArrayRef;
132133
template <typename T>
133134
using OptionalArrayRef =
134135
torch::executor::optional<torch::executor::ArrayRef<T>>;
136+
using OptionalIntArrayRef = OptionalArrayRef<int64_t>;
135137

136138
using torch::executor::compute_numel;
137139

0 commit comments

Comments
 (0)