Fix memory leak in SetOpAttrValueScalar

PiperOrigin-RevId: 306892886
Change-Id: I081750fba3407edc5974d5c16ac0a0bca84c4da9
This commit is contained in:
Akshay Modi 2020-04-16 11:57:26 -07:00 committed by TensorFlower Gardener
parent cafdb61a56
commit 28caea9247

View File

@ -1587,6 +1587,7 @@ void SetOpAttrValueScalar(TFE_Context* ctx, TFE_Op* op,
// require TFE_Op* and just convert it internally a NameAttrValue, so // require TFE_Op* and just convert it internally a NameAttrValue, so
// consider adding an overload to the C API to make this case easier. // consider adding an overload to the C API to make this case easier.
TFE_OpSetAttrFunction(op, attr_name, func_op); TFE_OpSetAttrFunction(op, attr_name, func_op);
TFE_DeleteOp(func_op);
} break; } break;
case tensorflow::AttrValue::kList: case tensorflow::AttrValue::kList:
TF_FALLTHROUGH_INTENDED; TF_FALLTHROUGH_INTENDED;