Skip to content
This repository was archived by the owner on Aug 15, 2019. It is now read-only.

Conversation

Lewuathe
Copy link
Contributor

@Lewuathe Lewuathe commented Apr 24, 2018

Purpose

Using same name variable in eager mode can lead memory leak. disposeVariables would be useful to make it possible to reuse same name variables.

see: tensorflow/tfjs#107


This change is Reviewable

@Lewuathe Lewuathe force-pushed the dispose-variables branch from c806c78 to 6dd02ba Compare April 24, 2018 13:07
@dsmilkov
Copy link
Contributor

Thanks! This is useful!


Review status: 0 of 2 files reviewed at latest revision, all discussions resolved.


src/engine_test.ts, line 540 at r1 (raw file):

      tf.tensor1d([1, 2, 3]).variable(true, 'v1');
    }).toThrowError();
    tf.environment.ENV.engine.disposeVariables();

Let's expose this method at the top level so users can call tf.disposeVariables(). Add disposeVariables as a static method to Environment with@doc decorator and expose it in index.ts. See Environment.getBackend() as an example how to expose to the top-level.


Comments from Reviewable

@Lewuathe Lewuathe force-pushed the dispose-variables branch from 6dd02ba to e053ca2 Compare April 25, 2018 08:30
@nsthorat
Copy link
Contributor

:lgtm_strong:


Review status: 0 of 4 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


Comments from Reviewable

@nsthorat nsthorat merged commit 81278ae into tensorflow:master Apr 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants