Skip to content
Permalink
Browse files Browse the repository at this point in the history
Check for type inference error on node construction.
PiperOrigin-RevId: 409415804
Change-Id: Ieb6e020906b96f522bf8e2fa103715ddbbdc434a
  • Loading branch information
Dan Moldovan authored and tensorflower-gardener committed Nov 12, 2021
1 parent 3d89911 commit 9550598
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tensorflow/core/graph/graph.cc
Expand Up @@ -561,6 +561,11 @@ Node* Graph::AddNode(NodeDef node_def, Status* status) {
VLOG(3) << "AddNode: found type constructor for " << node_def.name();
const auto ctor_type =
full_type::SpecializeType(AttrSlice(node_def), op_reg_data->op_def);
if (!ctor_type.ok()) {
*status = errors::InvalidArgument("type error: ",
ctor_type.status().ToString());
return nullptr;
}
const FullTypeDef ctor_typedef = ctor_type.ValueOrDie();
if (ctor_typedef.type_id() != TFT_UNSET) {
*(node_def.mutable_experimental_type()) = ctor_typedef;
Expand Down

0 comments on commit 9550598

Please sign in to comment.