face-api/build/common/disposeUnusedWeightTensors.js

12 lines
476 B
JavaScript
Raw Normal View History

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.disposeUnusedWeightTensors = void 0;
function disposeUnusedWeightTensors(weightMap, paramMappings) {
2020-08-18 14:04:33 +02:00
Object.keys(weightMap).forEach(path => {
if (!paramMappings.some(pm => pm.originalPath === path)) {
weightMap[path].dispose();
}
});
}
exports.disposeUnusedWeightTensors = disposeUnusedWeightTensors;
2020-08-18 14:04:33 +02:00
//# sourceMappingURL=disposeUnusedWeightTensors.js.map