|
|
@@ -733,7 +733,7 @@ ncnn.Metadata = class {
|
|
|
constructor(data) {
|
|
|
this._operatorMap = new Map();
|
|
|
this._map = new Map();
|
|
|
- this._attributeCache = new Map();
|
|
|
+ this._attributes = new Map();
|
|
|
if (data) {
|
|
|
const items = JSON.parse(data);
|
|
|
for (const item of items) {
|
|
|
@@ -757,18 +757,18 @@ ncnn.Metadata = class {
|
|
|
|
|
|
attribute(type, name) {
|
|
|
const key = type + ':' + name;
|
|
|
- if (!this._attributeCache.has(key)) {
|
|
|
+ if (!this._attributes.has(key)) {
|
|
|
const schema = this.type(type);
|
|
|
if (schema && schema.attributes && schema.attributes.length > 0) {
|
|
|
for (const attribute of schema.attributes) {
|
|
|
- this._attributeCache.set(type + ':' + attribute.name, attribute);
|
|
|
+ this._attributes.set(type + ':' + attribute.name, attribute);
|
|
|
}
|
|
|
}
|
|
|
- if (!this._attributeCache.has(key)) {
|
|
|
- this._attributeCache.set(key, null);
|
|
|
+ if (!this._attributes.has(key)) {
|
|
|
+ this._attributes.set(key, null);
|
|
|
}
|
|
|
}
|
|
|
- return this._attributeCache.get(key);
|
|
|
+ return this._attributes.get(key);
|
|
|
}
|
|
|
};
|
|
|
|