@timebutt/face-api.js
Version:
JavaScript API for face detection and face recognition in the browser with tensorflow.js
12 lines • 597 B
JavaScript
import { isTensor } from '../utils';
export function extractWeightEntryFactory(weightMap, paramMappings) {
return function (originalPath, paramRank, mappedPath) {
var tensor = weightMap[originalPath];
if (!isTensor(tensor, paramRank)) {
throw new Error("expected weightMap[".concat(originalPath, "] to be a Tensor").concat(paramRank, "D, instead have ").concat(tensor));
}
paramMappings.push({ originalPath: originalPath, paramPath: mappedPath || originalPath });
return tensor;
};
}
//# sourceMappingURL=extractWeightEntryFactory.js.map