Skip to content

Commit 62afbbf

Browse files
committed
Added NormalizeL2 test data
1 parent 8a7fc93 commit 62afbbf

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed
152 Bytes
Binary file not shown.
152 Bytes
Binary file not shown.

testdata/dnn/onnx/generate_onnx_models.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,3 +1233,16 @@ def forward(self, x):
12331233
x = Variable(torch.randn([1, 2, 2, 2]))
12341234
model = Mish()
12351235
save_data_and_model("mish", x, model)
1236+
1237+
class NormalizeFusion(nn.Module):
1238+
def forward(self, x):
1239+
mul = x * x
1240+
sum = torch.sum(mul, dim=(1), keepdim=True)
1241+
maximum = torch.clamp(sum, min=1e-8)
1242+
sqrt = torch.sqrt(maximum)
1243+
reciprocal = torch.reciprocal(sqrt)
1244+
return x * reciprocal
1245+
1246+
x = Variable(torch.randn([2, 3]))
1247+
model = NormalizeFusion()
1248+
save_data_and_model("normalize_fusion", x, model)
322 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)