@tensorflow/tfjs-converter
Advanced tools
Comparing version 1.0.0-alpha6 to 1.0.0-alpha7
@@ -28,5 +28,3 @@ /** | ||
private modelUrl; | ||
private requestOption?; | ||
private weightPrefix?; | ||
private onProgress?; | ||
private loadOptions; | ||
private executor; | ||
@@ -50,3 +48,3 @@ private version; | ||
*/ | ||
constructor(modelUrl: string | io.IOHandler, requestOption?: RequestInit, weightPrefix?: string, onProgress?: Function); | ||
constructor(modelUrl: string | io.IOHandler, loadOptions?: io.LoadOptions); | ||
private findIOHandler; | ||
@@ -53,0 +51,0 @@ /** |
@@ -73,8 +73,10 @@ "use strict"; | ||
*/ | ||
function GraphModel(modelUrl, requestOption, weightPrefix, onProgress) { | ||
function GraphModel(modelUrl, loadOptions) { | ||
if (loadOptions === void 0) { loadOptions = {}; } | ||
this.modelUrl = modelUrl; | ||
this.requestOption = requestOption; | ||
this.weightPrefix = weightPrefix; | ||
this.onProgress = onProgress; | ||
this.loadOptions = loadOptions; | ||
this.version = 'n/a'; | ||
if (loadOptions == null) { | ||
this.loadOptions = {}; | ||
} | ||
} | ||
@@ -130,11 +132,12 @@ Object.defineProperty(GraphModel.prototype, "modelVersion", { | ||
} | ||
else if (this.requestOption || this.weightPrefix) { | ||
this.handler = tfc.io.browserHTTPRequest(path, this.requestOption, this.weightPrefix, null, this.onProgress); | ||
else if (this.loadOptions.requestInit != null) { | ||
this.handler = | ||
tfc.io.browserHTTPRequest(path, this.loadOptions); | ||
} | ||
else { | ||
var handlers = tfc.io.getLoadHandlers(path, this.onProgress); | ||
var handlers = tfc.io.getLoadHandlers(path, this.loadOptions.onProgress); | ||
if (handlers.length === 0) { | ||
// For backward compatibility: if no load handler can be found, | ||
// assume it is a relative http path. | ||
handlers.push(tfc.io.browserHTTPRequest(path, this.requestOption, this.weightPrefix, null, this.onProgress)); | ||
handlers.push(tfc.io.browserHTTPRequest(path, this.loadOptions)); | ||
} | ||
@@ -367,3 +370,3 @@ else if (handlers.length > 1) { | ||
} | ||
model = new GraphModel(modelUrl, options.requestInit, null, options.onProgress); | ||
model = new GraphModel(modelUrl, options); | ||
return [4 /*yield*/, model.load()]; | ||
@@ -370,0 +373,0 @@ case 1: |
/** @license See the LICENSE file. */ | ||
declare const version = "1.0.0-alpha6"; | ||
declare const version = "1.0.0-alpha7"; | ||
export { version }; |
@@ -5,4 +5,4 @@ "use strict"; | ||
// This code is auto-generated, do not modify this file! | ||
var version = '1.0.0-alpha6'; | ||
var version = '1.0.0-alpha7'; | ||
exports.version = version; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@tensorflow/tfjs-converter", | ||
"version": "1.0.0-alpha6", | ||
"version": "1.0.0-alpha7", | ||
"description": "Tensorflow model converter for javascript", | ||
@@ -17,7 +17,8 @@ "main": "dist/src/index.js", | ||
"peerDependencies": { | ||
"@tensorflow/tfjs-core": "1.0.0-alpha4" | ||
"@tensorflow/tfjs-core": "1.0.0-alpha5" | ||
}, | ||
"devDependencies": { | ||
"@tensorflow/tfjs-core": "1.0.0-alpha4", | ||
"@tensorflow/tfjs-core": "1.0.0-alpha5", | ||
"@types/jasmine": "~2.8.6", | ||
"@types/long": "~3.0.32", | ||
"@types/node-fetch": "1.6.9", | ||
@@ -31,3 +32,3 @@ "ajv": "~6.3.0", | ||
"jasmine-core": "~3.1.0", | ||
"karma": "~4.0.0", | ||
"karma": "~4.0.1", | ||
"karma-browserstack-launcher": "~1.4.0", | ||
@@ -40,2 +41,3 @@ "karma-chrome-launcher": "~2.2.0", | ||
"opn": "~5.1.0", | ||
"protobufjs": "~6.8.6", | ||
"rimraf": "~2.6.2", | ||
@@ -52,5 +54,3 @@ "rollup": "~0.58.2", | ||
"typescript": "~2.9.2", | ||
"yalc": "~1.0.0-pre.21", | ||
"@types/long": "~3.0.32", | ||
"protobufjs": "~6.8.6" | ||
"yalc": "~1.0.0-pre.21" | ||
}, | ||
@@ -57,0 +57,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
14963
2021883