Sfoglia il codice sorgente

Update mslite-schema.js

Lutz Roeder 3 anni fa
parent
commit
bc237f0464
2 ha cambiato i file con 14 aggiunte e 3 eliminazioni
  1. 6 1
      source/mslite-metadata.json
  2. 8 2
      source/mslite-schema.js

+ 6 - 1
source/mslite-metadata.json

@@ -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",

+ 8 - 2
source/mslite-schema.js

@@ -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 $;
     }
 };