MCPcopy
hub / github.com/tensorflow/tfjs / dispose

Method dispose

tfjs-node/src/saved_model.ts:238–253  ·  view source on GitHub ↗

* 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'}

()

Source from the content-addressed store, hash-verified

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) {

Callers 15

image_test.tsFile · 0.45
encodeImageFunction · 0.45
FusedConv2D.tsFile · 0.45
All.tsFile · 0.45
Any.tsFile · 0.45
ResizeBilinear.tsFile · 0.45
CropAndResize.tsFile · 0.45
TopK.tsFile · 0.45
Transpose.tsFile · 0.45

Calls 3

deleteMethod · 0.80
deleteSavedModelMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected