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

Method saveFunc

tfjs-core/src/engine.ts:678–686  ·  view source on GitHub ↗
(tensors)

Source from the content-addressed store, hash-verified

676 const {forwardFunc} = kernelParams;
677 // Running a customGrad op.
678 const saveFunc: GradSaveFunc = (tensors) => {
679 // Do not save unless we are recording to the tape. Otherwise it would
680 // cause a mem leak since we would never run backprop, which disposes
681 // the kept tensors.
682 if (!isTapeOn) {
683 return;
684 }
685 saved = tensors.map(tensor => this.keep(this.clone(tensor)));
686 };
687
688 kernelFunc = () => {
689 const numDataIdsBefore = this.backend.numDataIds();

Callers

nothing calls this directly

Calls 2

keepMethod · 0.95
cloneMethod · 0.95

Tested by

no test coverage detected