Skip to content

Commit

Permalink
Update mslite-schema.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Sep 14, 2022
1 parent 8fdfc87 commit bc237f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion source/mslite-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,12 @@
]
},
{
"name": "Attention"
"name": "Attention",
"attributes": [
{ "name": "head_num", "type": "int64", "default": 0 },
{ "name": "head_size", "type": "int64", "default": 0 },
{ "name": "cross", "type": "boolean", "default": false }
]
},
{
"name": "AudioSpectrogram",
Expand Down
10 changes: 8 additions & 2 deletions source/mslite-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -1143,13 +1143,19 @@ $root.mindspore.schema.Concat = class Concat {

$root.mindspore.schema.Attention = class Attention {

static decode(/* reader, position */) {
static decode(reader, position) {
const $ = new $root.mindspore.schema.Attention();
$.head_num = reader.int64_(position, 4, 0);
$.head_size = reader.int64_(position, 6, 0);
$.cross = reader.bool_(position, 8, false);
return $;
}

static decodeText(/* reader, json */) {
static decodeText(reader, json) {
const $ = new $root.mindspore.schema.Attention();
$.head_num = reader.value(json.head_num, 0);
$.head_size = reader.value(json.head_size, 0);
$.cross = reader.value(json.cross, false);
return $;
}
};
Expand Down

0 comments on commit bc237f0

Please sign in to comment.