فهرست منبع

Update bigdl-metadata.json

Lutz Roeder 5 سال پیش
والد
کامیت
a53cd54074
2فایلهای تغییر یافته به همراه20 افزوده شده و 18 حذف شده
  1. 17 0
      source/bigdl-metadata.json
  2. 3 18
      source/bigdl.js

+ 17 - 0
source/bigdl-metadata.json

@@ -106,5 +106,22 @@
     "schema": {
       "category": "Shape"
     }
+  },
+  {
+    "name": "View",
+    "schema": {
+    }
+  },
+  {
+    "name": "JoinTable",
+    "schema": {
+      "category": "Tensor",
+      "inputs": [
+        { "name": "inputs", "list": true }
+      ],
+      "outputs": [
+        { "name": "output" }
+      ]
+    }
   }
 ]

+ 3 - 18
source/bigdl.js

@@ -219,7 +219,7 @@ bigdl.Node = class {
                 this._inputs.push(new bigdl.Parameter(key, value.arrayValue.tensor.map((tensor) => new bigdl.Argument('', null, new bigdl.Tensor(tensor)))));
                 continue;
             }
-            this._attributes.push(new bigdl.Attribute(metadata.attribute(this._type, key), key, value));
+            this._attributes.push(new bigdl.Attribute(key, value));
         }
         const output = this._name || this._type + module.namePostfix;
         this._outputs.push(new bigdl.Parameter('output', [
@@ -258,7 +258,7 @@ bigdl.Node = class {
 
 bigdl.Attribute = class {
 
-    constructor(schema, name, value) {
+    constructor(name, value) {
         this._name = name;
         switch (value.dataType) {
             case bigdl.proto.DataType.INT32: {
@@ -336,7 +336,7 @@ bigdl.Attribute = class {
     }
 
     get type() {
-        return '';
+        return this._type;
     }
 
     get name() {
@@ -455,21 +455,6 @@ bigdl.Metadata = class {
     type(name) {
         return this._map[name] || null;
     }
-
-    attribute(type, name) {
-        let map = this._attributeCache[type];
-        if (!map) {
-            map = {};
-            const schema = this.type(type);
-            if (schema && schema.attributes && schema.attributes.length > 0) {
-                for (const attribute of schema.attributes) {
-                    map[attribute.name] = attribute;
-                }
-            }
-            this._attributeCache[type] = map;
-        }
-        return map[name] || null;
-    }
 };
 
 bigdl.Error = class extends Error {