* Delete the SavedModel from nodeBackend and delete corresponding session in * the C++ backend if the session is only used by this TFSavedModel. * * @doc {heading: 'Models', subheading: 'SavedModel'}
()
| 236 | * @doc {heading: 'Models', subheading: 'SavedModel'} |
| 237 | */ |
| 238 | dispose() { |
| 239 | if (!this.disposed) { |
| 240 | this.disposed = true; |
| 241 | |
| 242 | loadedSavedModelPathMap.delete(this.jsid); |
| 243 | for (const id of Array.from(loadedSavedModelPathMap.keys())) { |
| 244 | const value = loadedSavedModelPathMap.get(id); |
| 245 | if (value.sessionId === this.sessionId) { |
| 246 | return; |
| 247 | } |
| 248 | } |
| 249 | this.backend.deleteSavedModel(this.sessionId); |
| 250 | } else { |
| 251 | throw new Error('This SavedModel has already been deleted.'); |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | get outputNodeNames() { |
| 256 | if (this.outputNodeNames_ != null) { |
no test coverage detected