Skip to content

Instantly share code, notes, and snippets.

@AmosLewis
Created January 17, 2023 07:35
Show Gist options
  • Save AmosLewis/144ff9fae33e1bf99cd3986326914cd4 to your computer and use it in GitHub Desktop.
Save AmosLewis/144ff9fae33e1bf99cd3986326914cd4 to your computer and use it in GitHub Desktop.
module attributes {torch.debug_module_name = "IndexTensorMultiInputContiguousCenter"} {
func.func @forward(%arg0: !torch.vtensor<[?,?,?,?],f32>, %arg1: !torch.vtensor<[2,2],si64>, %arg2: !torch.vtensor<[2],si64>) -> !torch.vtensor<[?,2,2,?],f32> {
%none = torch.constant.none
%0 = torch.prim.ListConstruct %none, %arg1, %arg2, %none : (!torch.none, !torch.vtensor<[2,2],si64>, !torch.vtensor<[2],si64>, !torch.none) -> !torch.list<optional<vtensor>>
%1 = torch.aten.index.Tensor %arg0, %0 : !torch.vtensor<[?,?,?,?],f32>, !torch.list<optional<vtensor>> -> !torch.vtensor<[?,2,2,?],f32>
return %1 : !torch.vtensor<[?,2,2,?],f32>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment