tensorflow/compiler/xla/service/gpu/tests/swap_conv_operands_test.cc
// If the padding is already small, we leave the operands as-is before lowering.
If the padding is already small, we leave the operands as-is before lowering.
If the padding is already small we leave the operands as - is before lowering .
TEST_F(SwapConvOperandsTest, SmallPadding) {
  const char* hlo_text = R"(
HloModule swap_conv
ENTRY swap_conv {
  filter = f32[512,128,3,3]{3,2,1,0} parameter(0)
  input = f32[1,30,30,512]{3,2,1,0}  parameter(1)
  convolution = f32[1,32,32,128]{2,1,3,0} convolution(input, filter), window={size=3x3 pad=2_2x2_2 rhs_reversal=1x1}, dim_labels=b01f_io01->b01f
  ROOT tuple = (f32[1,32,32,128]{3,2,1,0}) tuple(convolution)
}
)";
  MatchOptimizedHloWithShapes(hlo_text,
                              R"(
// CHECK-LABEL: ENTRY
// CHECK:   [[INPUT:%[^ ]+]] = f32[1,30,30,512]{2,1,3,0}
// CHECK:   [[FILTER:%[^ ]+]] = f32[512,128,3,3]{3,2,0,1}
// CHECK:   %cudnn-conv = (f32[1,32,32,128]{2,1,3,0}, u8[{{[0-9]*}}]{0}) custom-call(f32[1,30,30,512]{2,1,3,0} [[INPUT]], f32[512,128,3,3]{3,2,0,1} [[FILTER]]), window={size=3x3 pad=2_2x2_2 rhs_reversal=1x1}, dim_labels=b01f_io01->b01f
      )");
  EXPECT_TRUE(RunAndCompare(hlo_text, ErrorSpec{1e-5, 1e-5}));
}
TEST_F ( SwapConvOperandsTest , SmallPadding ) { const char * hlo_text = R" ( 
HloModule swap_conv

ENTRY swap_conv {
  filter = f32[512,128,3,3]{3,2,1,0} parameter(0)
  input = f32[1,30,30,512]{3,2,1,0}  parameter(1)
  convolution = f32[1,32,32,128]{2,1,3,0} convolution(input, filter), window={size=3x3 pad=2_2x2_2 rhs_reversal=1x1}, dim_labels=b01f_io01->b01f
  ROOT tuple = (f32[1,32,32,128]{3,2,1,0}) tuple(convolution)
}
 ) " ; MatchOptimizedHloWithShapes ( hlo_text , R" ( 
// CHECK-LABEL: ENTRY
// CHECK:   [[INPUT:%[^ ]+]] = f32[1,30,30,512]{2,1,3,0}
// CHECK:   [[FILTER:%[^ ]+]] = f32[512,128,3,3]{3,2,0,1}
// CHECK:   %cudnn-conv = (f32[1,32,32,128]{2,1,3,0}, u8[{{[0-9]*}}]{0}) custom-call(f32[1,30,30,512]{2,1,3,0} [[INPUT]], f32[512,128,3,3]{3,2,0,1} [[FILTER]]), window={size=3x3 pad=2_2x2_2 rhs_reversal=1x1}, dim_labels=b01f_io01->b01f
       ) " ) ; EXPECT_TRUE ( RunAndCompare ( hlo_text , ErrorSpec { 1e-5 , 1e-5 } ) ) ; }
If the padding is already small, we leave the operands as-is before lowering.
If the padding is already small we leave the operands as - is before lowering .