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

Save tensor x in forward mode when zerosLike(x) is used in backward mode #1636

Merged
merged 1 commit into from
Mar 20, 2019

Conversation

dsmilkov
Copy link
Contributor

@dsmilkov dsmilkov commented Mar 19, 2019

In our webgl and cpu backend, zerosLike(x) and onesLike(x) don't care if x is disposed, because they only need its shape.

In the tfjs-node backend however, calls to TF C++ kernel zerosLike(x) requires that x is not disposed.

Because of this discrepancy, we need to call save(x) during forward pass for all ops that use zerosLike(x) and onesLike(x) in the backwards pass.

This fixes the failing integration test in tfjs-node here: https://travis-ci.org/tensorflow/tfjs-core/jobs/508508231#L893


This change is Reviewable

@dsmilkov dsmilkov requested review from nkreeger and nsthorat March 19, 2019 21:49
Copy link
Contributor

@nsthorat nsthorat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 3 files at r1.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @nkreeger and @nsthorat)

@dsmilkov dsmilkov merged commit 84b7e9f into master Mar 20, 2019
@dsmilkov dsmilkov deleted the fix-der branch March 20, 2019 15:32
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.

2 participants