Skip to content

Commit abecb73

Browse files
Vysaratfacebook-github-bot
authored andcommitted
Add int16 support to aten_bridge (#3069)
Summary: Running an executorch program via pybindings requires the aten_bridge. This currently fails if the model uses the `int16` dtype. This diff adds support for the type by adding it to the conversion switch statements. Differential Revision: D56199304
1 parent 9931301 commit abecb73

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

extension/aten_util/aten_bridge.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ torch::executor::ScalarType torchToExecuTorchScalarType(caffe2::TypeMeta type) {
6868
return torch::executor::ScalarType::Byte;
6969
case c10::ScalarType::Char:
7070
return torch::executor::ScalarType::Char;
71+
case c10::ScalarType::Short:
72+
return torch::executor::ScalarType::Short;
7173
case c10::ScalarType::Half:
7274
return torch::executor::ScalarType::Half;
7375
case c10::ScalarType::Int:
@@ -95,6 +97,8 @@ c10::ScalarType execuTorchtoTorchScalarType(torch::executor::ScalarType type) {
9597
return c10::ScalarType::Byte;
9698
case torch::executor::ScalarType::Char:
9799
return c10::ScalarType::Char;
100+
case torch::executor::ScalarType::Short:
101+
return c10::ScalarType::Short;
98102
case torch::executor::ScalarType::Half:
99103
return c10::ScalarType::Half;
100104
case torch::executor::ScalarType::Int:

0 commit comments

Comments
 (0)