Skip to content

Commit

Permalink
Add int16 support to aten_bridge (#3069)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #3069

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.

Reviewed By: tarun292

Differential Revision: D56199304

fbshipit-source-id: 19a6815cf2885dda72febf247c3ca3bde91193a8
  • Loading branch information
Vysarat authored and facebook-github-bot committed Apr 16, 2024
1 parent c73bfc0 commit eb664a0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions extension/aten_util/aten_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ torch::executor::ScalarType torchToExecuTorchScalarType(caffe2::TypeMeta type) {
return torch::executor::ScalarType::Byte;
case c10::ScalarType::Char:
return torch::executor::ScalarType::Char;
case c10::ScalarType::Short:
return torch::executor::ScalarType::Short;
case c10::ScalarType::Half:
return torch::executor::ScalarType::Half;
case c10::ScalarType::Int:
Expand Down Expand Up @@ -95,6 +97,8 @@ c10::ScalarType execuTorchtoTorchScalarType(torch::executor::ScalarType type) {
return c10::ScalarType::Byte;
case torch::executor::ScalarType::Char:
return c10::ScalarType::Char;
case torch::executor::ScalarType::Short:
return c10::ScalarType::Short;
case torch::executor::ScalarType::Half:
return c10::ScalarType::Half;
case torch::executor::ScalarType::Int:
Expand Down

0 comments on commit eb664a0

Please sign in to comment.