Skip to content

Commit 5741daf

Browse files
philloooochromium-wpt-export-bot
authored andcommitted
webnn: implement lstmCell in CoreML
Implemented as a single step lstm. Change-Id: Ia1d50cbf16985a1bc45a367831ccfe085fa51379 Bug: 360052663 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6082391 Commit-Queue: Phillis Tang <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Cr-Commit-Position: refs/heads/main@{#1394521}
1 parent bf4c6fa commit 5741daf

File tree

1 file changed

+44
-22
lines changed

1 file changed

+44
-22
lines changed

webnn/conformance_tests/lstm_cell.https.any.js

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@ const lstmCellTests = [
6363
},
6464
'lstmCellWeight': {
6565
'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2],
66-
'descriptor': {shape: [8, 2], dataType: 'float32'}
66+
'descriptor': {shape: [8, 2], dataType: 'float32'},
67+
'constant': true
6768
},
6869
'lstmCellRecurrentWeight': {
6970
'data': [
7071
0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
7172
0.1, 0.1, 0.1
7273
],
73-
'descriptor': {shape: [8, 2], dataType: 'float32'}
74+
'descriptor': {shape: [8, 2], dataType: 'float32'},
75+
'constant': true
7476
},
7577
'lstmCellHiddenState': {
7678
'data': [0, 0, 0, 0],
@@ -82,11 +84,13 @@ const lstmCellTests = [
8284
},
8385
'lstmCellBias': {
8486
'data': [1, 2, 1, 2, 1, 2, 1, 2],
85-
'descriptor': {shape: [8], dataType: 'float32'}
87+
'descriptor': {shape: [8], dataType: 'float32'},
88+
'constant': true
8689
},
8790
'lstmCellRecurrentBias': {
8891
'data': [1, 2, 1, 2, 1, 2, 1, 2],
89-
'descriptor': {shape: [8], dataType: 'float32'}
92+
'descriptor': {shape: [8], dataType: 'float32'},
93+
'constant': true
9094
}
9195
},
9296
'operators': [{
@@ -128,14 +132,16 @@ const lstmCellTests = [
128132
},
129133
'lstmCellWeight': {
130134
'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2],
131-
'descriptor': {shape: [8, 2], dataType: 'float32'}
135+
'descriptor': {shape: [8, 2], dataType: 'float32'},
136+
'constant': true
132137
},
133138
'lstmCellRecurrentWeight': {
134139
'data': [
135140
0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
136141
0.1, 0.1, 0.1
137142
],
138-
'descriptor': {shape: [8, 2], dataType: 'float32'}
143+
'descriptor': {shape: [8, 2], dataType: 'float32'},
144+
'constant': true
139145
},
140146
'lstmCellHiddenState': {
141147
'data': [0, 0, 0, 0],
@@ -147,15 +153,18 @@ const lstmCellTests = [
147153
},
148154
'lstmCellBias': {
149155
'data': [1, 2, 1, 2, 1, 2, 1, 2],
150-
'descriptor': {shape: [8], dataType: 'float32'}
156+
'descriptor': {shape: [8], dataType: 'float32'},
157+
'constant': true
151158
},
152159
'lstmCellRecurrentBias': {
153160
'data': [1, 2, 1, 2, 1, 2, 1, 2],
154-
'descriptor': {shape: [8], dataType: 'float32'}
161+
'descriptor': {shape: [8], dataType: 'float32'},
162+
'constant': true
155163
},
156164
'lstmCellPeepholeWeight': {
157165
'data': [0, 0, 0, 0, 0, 0],
158-
'descriptor': {shape: [6], dataType: 'float32'}
166+
'descriptor': {shape: [6], dataType: 'float32'},
167+
'constant': true
159168
}
160169
},
161170
'operators': [{
@@ -198,14 +207,16 @@ const lstmCellTests = [
198207
},
199208
'lstmCellWeight': {
200209
'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2],
201-
'descriptor': {shape: [8, 2], dataType: 'float32'}
210+
'descriptor': {shape: [8, 2], dataType: 'float32'},
211+
'constant': true
202212
},
203213
'lstmCellRecurrentWeight': {
204214
'data': [
205215
0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
206216
0.1, 0.1, 0.1
207217
],
208-
'descriptor': {shape: [8, 2], dataType: 'float32'}
218+
'descriptor': {shape: [8, 2], dataType: 'float32'},
219+
'constant': true
209220
},
210221
'lstmCellHiddenState': {
211222
'data': [0, 0, 0, 0],
@@ -217,11 +228,13 @@ const lstmCellTests = [
217228
},
218229
'lstmCellBias': {
219230
'data': [1, 2, 1, 2, 1, 2, 1, 2],
220-
'descriptor': {shape: [8], dataType: 'float32'}
231+
'descriptor': {shape: [8], dataType: 'float32'},
232+
'constant': true
221233
},
222234
'lstmCellRecurrentBias': {
223235
'data': [1, 2, 1, 2, 1, 2, 1, 2],
224-
'descriptor': {shape: [8], dataType: 'float32'}
236+
'descriptor': {shape: [8], dataType: 'float32'},
237+
'constant': true
225238
}
226239
},
227240
'operators': [{
@@ -264,14 +277,16 @@ const lstmCellTests = [
264277
},
265278
'lstmCellWeight': {
266279
'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2],
267-
'descriptor': {shape: [8, 2], dataType: 'float32'}
280+
'descriptor': {shape: [8, 2], dataType: 'float32'},
281+
'constant': true
268282
},
269283
'lstmCellRecurrentWeight': {
270284
'data': [
271285
0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
272286
0.1, 0.1, 0.1
273287
],
274-
'descriptor': {shape: [8, 2], dataType: 'float32'}
288+
'descriptor': {shape: [8, 2], dataType: 'float32'},
289+
'constant': true
275290
},
276291
'lstmCellHiddenState': {
277292
'data': [0, 0, 0, 0],
@@ -283,11 +298,13 @@ const lstmCellTests = [
283298
},
284299
'lstmCellBias': {
285300
'data': [1, 2, 1, 2, 1, 2, 1, 2],
286-
'descriptor': {shape: [8], dataType: 'float32'}
301+
'descriptor': {shape: [8], dataType: 'float32'},
302+
'constant': true
287303
},
288304
'lstmCellRecurrentBias': {
289305
'data': [1, 2, 1, 2, 1, 2, 1, 2],
290-
'descriptor': {shape: [8], dataType: 'float32'}
306+
'descriptor': {shape: [8], dataType: 'float32'},
307+
'constant': true
291308
}
292309
},
293310
'operators': [{
@@ -329,14 +346,16 @@ const lstmCellTests = [
329346
},
330347
'lstmCellWeight': {
331348
'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2],
332-
'descriptor': {shape: [8, 2], dataType: 'float32'}
349+
'descriptor': {shape: [8, 2], dataType: 'float32'},
350+
'constant': true
333351
},
334352
'lstmCellRecurrentWeight': {
335353
'data': [
336354
0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
337355
0.1, 0.1, 0.1
338356
],
339-
'descriptor': {shape: [8, 2], dataType: 'float32'}
357+
'descriptor': {shape: [8, 2], dataType: 'float32'},
358+
'constant': true
340359
},
341360
'lstmCellHiddenState': {
342361
'data': [0, 0, 0, 0],
@@ -348,15 +367,18 @@ const lstmCellTests = [
348367
},
349368
'lstmCellBias': {
350369
'data': [1, 2, 1, 2, 1, 2, 1, 2],
351-
'descriptor': {shape: [8], dataType: 'float32'}
370+
'descriptor': {shape: [8], dataType: 'float32'},
371+
'constant': true
352372
},
353373
'lstmCellRecurrentBias': {
354374
'data': [1, 2, 1, 2, 1, 2, 1, 2],
355-
'descriptor': {shape: [8], dataType: 'float32'}
375+
'descriptor': {shape: [8], dataType: 'float32'},
376+
'constant': true
356377
},
357378
'lstmCellPeepholeWeight': {
358379
'data': [0, 0, 0, 0, 0, 0],
359-
'descriptor': {shape: [6], dataType: 'float32'}
380+
'descriptor': {shape: [6], dataType: 'float32'},
381+
'constant': true
360382
}
361383
},
362384
'operators': [{

0 commit comments

Comments
 (0)