Skip to content

[r1.15-CherryPick]:Disallow comparing ObjectIdentityWrapper to others#32526

Merged
goldiegadde merged 2 commits into
tensorflow:r1.15from
jaingaurav:cherry-1.15-2
Sep 16, 2019
Merged

[r1.15-CherryPick]:Disallow comparing ObjectIdentityWrapper to others#32526
goldiegadde merged 2 commits into
tensorflow:r1.15from
jaingaurav:cherry-1.15-2

Conversation

@jaingaurav

Copy link
Copy Markdown
Contributor

When using the experimental_ref() API in Tensors & Variables. A common
bug I hit was incorrectly comparing a wrapped object with an unwrapped
object instead of first calling deref(). To avoid this we raise an
exception now instead of returning False. This implies that if Tensors
and Variables are kept in the same set or dictionary as other objects,
an exception can be raised if there is a hash collision.

PiperOrigin-RevId: 268837575
(cherry picked from commit 57e8769)

@tensorflow-bot tensorflow-bot Bot added the size:S CL Change Size: Small label Sep 14, 2019
mihaimaruseac
mihaimaruseac previously approved these changes Sep 14, 2019
@goldiegadde goldiegadde changed the title Disallow comparing ObjectIdentityWrapper to others [r1.15-CherryPick]:Disallow comparing ObjectIdentityWrapper to others Sep 14, 2019
When using the experimental_ref() API in Tensors & Variables. A common
bug I hit was incorrectly comparing a wrapped object with an unwrapped
object instead of first calling deref(). To avoid this we raise an
exception now instead of returning False. This implies that if Tensors
and Variables are kept in the same set or dictionary as other objects,
an exception can be raised if there is a hash collision.

PiperOrigin-RevId: 268837575
(cherry picked from commit 57e8769)
@jaingaurav jaingaurav added the kokoro:force-run Tests on submitted change label Sep 15, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Sep 15, 2019
@goldiegadde goldiegadde self-requested a review September 16, 2019 05:00
@goldiegadde goldiegadde merged commit ea93078 into tensorflow:r1.15 Sep 16, 2019
@jaingaurav jaingaurav deleted the cherry-1.15-2 branch November 15, 2019 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes size:S CL Change Size: Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants