dispose() {
        this.executor.dispose();
        if (this.initializer) {
            this.initializer.dispose();
            if (this.resourceIdToCapturedInput) (0, _tfjsCore.dispose)(this.resourceIdToCapturedInput);
        }
        this.resourceManager.dispose();
    }
Releases the memory used by the weight tensors and resourceManager.

@doc {heading: 'Models', subheading: 'Classes'}