Skip to content

Commit 9beaefb

Browse files
authored
Merge pull request #1044 from fengyuentau:add_gelu
Add data & models for GELU layer * add data & model * add generator
1 parent 9481b5a commit 9beaefb

File tree

7 files changed

+9
-0
lines changed

7 files changed

+9
-0
lines changed
528 Bytes
Binary file not shown.
528 Bytes
Binary file not shown.
528 Bytes
Binary file not shown.
528 Bytes
Binary file not shown.

testdata/dnn/onnx/generate_onnx_models.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2598,3 +2598,12 @@ def make_node_with_constant(op_type, constant_value, inputs=None, outputs=None,
25982598

25992599
gen_layer_norm_expanded()
26002600
gen_layer_norm_expanded(constant_as_initializers=True)
2601+
2602+
################# GELU #################
2603+
2604+
x = torch.randn(1, 5, 20)
2605+
gelu = nn.GELU()
2606+
save_data_and_model("gelu", x, gelu)
2607+
2608+
gelu_approximation = nn.GELU('tanh')
2609+
save_data_and_model("gelu_approximation", x, gelu_approximation)

testdata/dnn/onnx/models/gelu.onnx

580 Bytes
Binary file not shown.
918 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)