Merge pull request #20800 from tianyapiaozi:fix

PiperOrigin-RevId: 236402237
This commit is contained in:
TensorFlower Gardener 2019-03-01 16:57:51 -08:00
commit 93b0d11117

View File

@ -79,7 +79,7 @@ Status ShapeForPlaceholder(const TransformFuncContext& context,
*result = {};
// Check to see if we have been given a default for all placeholders.
if (context.params.count("type")) {
if (context.params.count("shape")) {
if (context.params.at("shape").size() != 1) {
return errors::InvalidArgument(
"You must pass no more than one default 'shape' to "
@ -90,10 +90,10 @@ Status ShapeForPlaceholder(const TransformFuncContext& context,
}
// See if there's a particular type specified for this placeholder.
if (context.params.count("name") || context.params.count("type_for_name")) {
if (context.params.count("name") || context.params.count("shape_for_name")) {
if (!context.params.count("name") ||
!context.params.count("type_for_name") ||
(context.params.at("type_for_name").size() !=
!context.params.count("shape_for_name") ||
(context.params.at("shape_for_name").size() !=
context.params.at("name").size())) {
return errors::InvalidArgument(
"You must pass a 'shape_for_name' arg for every 'name', e.g. "