mirror of https://github.com/llvm/torch-mlir
71d90788d3
This PR support `aten.view` with unique unknown dimension both in input shape and output shape while the pass convert-torch-to-linalg that lowing `aten.view` to `tensor.collapse_shape` or `tensor.expand_shape`. Below is an example ``` func.func @test_reshape(%arg0: !torch.vtensor<[1,?,50,16],f32>) -> !torch.vtensor<[1,?,16],f32> attributes {torch.assume_strict_symbolic_shapes, torch.onnx_meta.ir_version = 9 : si64, torch.onnx_meta.opset_version = 19 : si64, torch.onnx_meta.producer_name = "backend-test", torch.onnx_meta.producer_version = ""} { %int1 = torch.constant.int 1 %int-1 = torch.constant.int -1 %int16 = torch.constant.int 16 %0 = torch.prim.ListConstruct %int1, %int-1, %int16 : (!torch.int, !torch.int, !torch.int) -> !torch.list<int> %1 = torch.aten.view %arg0, %0 : !torch.vtensor<[1,?,50,16],f32>, !torch.list<int> -> !torch.vtensor<[1,?,16],f32> return %1 : !torch.vtensor<[1,?,16],f32> } ``` |
||
---|---|---|
.. | ||
CAPI | ||
Conversion | ||
Dialect | ||
RefBackend | ||
CMakeLists.txt | ||
InitAll.cpp |