Commit 72c5efff authored by Asim Shankar's avatar Asim Shankar Committed by TensorFlower Gardener
Browse files

[C API/Eager]: Fix bug in TFE_OpSetAttrString.

TFE_OpSetAttrString was holding on to the 'value' pointer
after it returned. This bug was introduced in commit
2b080530
which caused TFE_OpSetAttrString to invoke
AttrBuilder& AttrBuilder::Set(StringPiece attr_name, StringPiece&& value);
instead of:
AttrBuilder& AttrBuilder::Set(StringPiece attr_name, T&& value)
(where the latter copies 'value' when T is a StringPiece or const char*
and the former aliases the memory pointed to by StringPiece).

In this process, I realized that
AttrBuilder::Set(StringPiece attr_name, StringPiece&& value)
was never being invoked (other than in this buggy situation),
so I removed it altogether.

Without the changes to attr_builder.{h,cc}, the newly added test
fails - complaining that "NHWC" is not a valid value for the "padding"
attribute.

PiperOrigin-RevId: 209017110
parent e77dbdb2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment