test: add e2e tests of grouped conv2d

This commit is contained in:
youben11
2022-08-04 09:13:12 +01:00
committed by Ayoub Benaissa
parent ce9393070c
commit cace7f1ebb

View File

@@ -27,3 +27,54 @@ tests:
outputs:
- tensor: [1, 3, 5, 2, 4, 6]
shape: [2, 3]
---
description: conv2dWithGroup1C
program: |
func.func @main(%input: tensor<1x6x4x4x!FHE.eint<5>>, %weight: tensor<6x1x2x2xi6>) -> tensor<1x6x3x3x!FHE.eint<5>> {
%1 = "FHELinalg.conv2d"(%input, %weight){group = 6 : i64}: (tensor<1x6x4x4x!FHE.eint<5>>, tensor<6x1x2x2xi6>) -> tensor<1x6x3x3x!FHE.eint<5>>
return %1 : tensor<1x6x3x3x!FHE.eint<5>>
}
tests:
- inputs:
- tensor: [
1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4,
1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4,
1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4,
1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4,
]
shape: [1, 6, 4, 4]
width: 8
- tensor: [1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]
shape: [6, 1, 2, 2]
width: 8
outputs:
- tensor: [10, 16, 22, 10, 16, 22, 10, 16, 22, 10, 16, 22, 10, 16, 22, 10, 16, 22,
10, 16, 22, 10, 16, 22, 10, 16, 22, 10, 16, 22, 10, 16, 22, 10, 16, 22,
10, 16, 22, 10, 16, 22, 10, 16, 22, 10, 16, 22, 10, 16, 22, 10, 16, 22]
shape: [1, 6, 3, 3]
---
description: conv2dWithGroup2C
program: |
func.func @main(%input: tensor<1x6x4x4x!FHE.eint<5>>, %weight: tensor<3x2x2x2xi6>) -> tensor<1x3x3x3x!FHE.eint<5>> {
%1 = "FHELinalg.conv2d"(%input, %weight){group = 3 : i64}: (tensor<1x6x4x4x!FHE.eint<5>>, tensor<3x2x2x2xi6>) -> tensor<1x3x3x3x!FHE.eint<5>>
return %1 : tensor<1x3x3x3x!FHE.eint<5>>
}
tests:
- inputs:
- tensor: [
1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4,
1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4,
1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4,
1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4,
]
shape: [1, 6, 4, 4]
width: 8
- tensor: [1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2]
shape: [3, 2, 2, 2]
width: 8
outputs:
- tensor: [
20, 32, 44, 20, 32, 44, 20, 32, 44, 20, 32, 44, 20, 32, 44, 20, 32, 44,
20, 32, 44, 20, 32, 44, 20, 32, 44,
]
shape: [1, 3, 3, 3]