Skip to content

Commit 4b6b140

Browse files
committed
[circle-mlir] Introduce unit test model for Transpose
This will introduce unit test model for Transpose conversion. ONE-DCO-1.0-Signed-off-by: SaeHie Park <saehie.park@gmail.com>
1 parent 2f0f776 commit 4b6b140

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import torch
2+
3+
4+
# Generate Transpose operator with Float32, Rank-4
5+
class net_Transpose(torch.nn.Module):
6+
def __init__(self):
7+
super().__init__()
8+
9+
def forward(self, input):
10+
# NOTE two transpose will produce NCHW to NHWC single transpose
11+
x = torch.transpose(input, 1, 3)
12+
return torch.transpose(x, 1, 2)
13+
14+
def onnx_opset_version(self):
15+
# TODO set to appropriate value
16+
return 13
17+
18+
19+
_model_ = net_Transpose()
20+
21+
_inputs_ = torch.randn(1, 3, 6, 4)

0 commit comments

Comments
 (0)