From 3465b59053cb15b7b3d2069051e94bc42ba4d0ca Mon Sep 17 00:00:00 2001 From: Vivek Khandelwal Date: Mon, 7 Oct 2024 07:15:28 +0000 Subject: [PATCH] Update filechecks for failing test --- .../fx_importer/symbolic_shape_expr_test.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/python/fx_importer/symbolic_shape_expr_test.py b/test/python/fx_importer/symbolic_shape_expr_test.py index 4b66204983453..1aad9ca2cbab3 100644 --- a/test/python/fx_importer/symbolic_shape_expr_test.py +++ b/test/python/fx_importer/symbolic_shape_expr_test.py @@ -129,13 +129,15 @@ def forward(self, x, y): # CHECK: func.func @main(%[[ARG0:.+]]: !torch.vtensor<[?],f32>) -> !torch.vtensor<[?],f32> { # CHECK: %[[S0:.+]] = torch.symbolic_int "s0" {min_val = {{[0-9]+}}, max_val = {{[0-9]+}}} : !torch.int # CHECK: torch.bind_symbolic_shape %[[ARG0]], [%[[S0]]], affine_map<()[s0] -> (s0)> : !torch.vtensor<[?],f32> -# CHECK: %[[VIEW1:.+]] = torch.aten.view %[[ARG0]], {{.*}} : !torch.vtensor<[?],f32>, !torch.list -> !torch.vtensor<[?,1],f32> -# CHECK: torch.bind_symbolic_shape %[[VIEW1]], [%[[S0]]], affine_map<()[s0] -> (s0, 1)> : !torch.vtensor<[?,1],f32> -# CHECK: %[[MUL:.+]] = torch.aten.mul.Tensor %[[VIEW1]], %[[ARG0]] : !torch.vtensor<[?,1],f32>, !torch.vtensor<[?],f32> -> !torch.vtensor<[?,?],f32> -# CHECK: torch.bind_symbolic_shape %[[MUL]], [%[[S0]]], affine_map<()[s0] -> (s0, s0)> : !torch.vtensor<[?,?],f32> -# CHECK: %[[VIEW2:.+]] = torch.aten.view %[[MUL]], {{.*}} : !torch.vtensor<[?,?],f32>, !torch.list -> !torch.vtensor<[?],f32> -# CHECK: torch.bind_symbolic_shape %[[VIEW2]], [%[[S0]]], affine_map<()[s0] -> (s0 * s0)> : !torch.vtensor<[?],f32> -# CHECK: return %[[VIEW2]] : !torch.vtensor<[?],f32> +# CHECK: %[[I0:.+]] = torch.constant.int 0 +# CHECK: %[[SIZE:.+]] = torch.aten.size.int %[[ARG0]], %[[I0]] : !torch.vtensor<[?],f32>, !torch.int -> !torch.int +# CHECK: %[[OUTER:.+]] = torch.operator "torch.aten.outer"(%[[ARG0]], %[[ARG0]]) : (!torch.vtensor<[?],f32>, !torch.vtensor<[?],f32>) -> !torch.vtensor<[?,?],f32> +# CHECK: torch.bind_symbolic_shape %[[OUTER]], [%[[S0]]], affine_map<()[s0] -> (s0, s0)> : !torch.vtensor<[?,?],f32> +# CHECK: %[[MUL:.+]] = torch.aten.mul.int %[[SIZE]], %[[SIZE]] : !torch.int, !torch.int -> !torch.int +# CHECK: %[[LIST:.+]] = torch.prim.ListConstruct %[[MUL]] : (!torch.int) -> !torch.list +# CHECK: %[[VIEW:.+]] = torch.aten.view %[[OUTER]], %[[LIST]] : !torch.vtensor<[?,?],f32>, !torch.list -> !torch.vtensor<[?],f32> +# CHECK: torch.bind_symbolic_shape %[[VIEW]], [%[[S0]]], affine_map<()[s0] -> (s0 * s0)> : !torch.vtensor<[?],f32> +# CHECK: return %[[VIEW]] : !torch.vtensor<[?],f32> def test_outer_with_squared_shape(): class OuterWithSquaredShape(torch.nn.Module): def __init__(self):