MCPcopy Create free account
hub / github.com/tensorflow/tfjs / clearAndClose

Method clearAndClose

tfjs-converter/src/executor/tensor_array.ts:55–64  ·  view source on GitHub ↗

* Dispose the tensors and idTensor and mark the TensoryArray as closed.

(keepIds?: Set<number>)

Source from the content-addressed store, hash-verified

53 * Dispose the tensors and idTensor and mark the TensoryArray as closed.
54 */
55 clearAndClose(keepIds?: Set<number>) {
56 this.tensors.forEach(tensor => {
57 if (keepIds == null || !keepIds.has(tensor.tensor.id)) {
58 tensor.tensor.dispose();
59 }
60 });
61 this.tensors = [];
62 this.closed_ = true;
63 this.idTensor.dispose();
64 }
65
66 size(): number {
67 return this.tensors.length;

Callers

nothing calls this directly

Calls 2

hasMethod · 0.80
disposeMethod · 0.45

Tested by

no test coverage detected