Skip to content

Commit

Permalink
[tf.data] Improve input pipeline cloning error message.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 275558079
Change-Id: I20605a64b5a7bbb8d1465b53f7c4d1459bcb4296
  • Loading branch information
jsimsa authored and tensorflower-gardener committed Oct 18, 2019
1 parent 4737472 commit 02fa654
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tensorflow/core/kernels/data/dataset_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,14 @@ void DatasetToGraphOp::Compute(OpKernelContext* ctx) {
(external_state_policy_ == ExternalStatePolicy::kFail);

GraphDef graph_def;
OP_REQUIRES_OK(
ctx, AsGraphDef(ctx, dataset, SerializationContext(params), &graph_def));
Status s = AsGraphDef(ctx, dataset, SerializationContext(params), &graph_def);
if (!s.ok()) {
ctx->CtxFailure(errors::FailedPrecondition(
"Failed to clone the input pipeline because the input pipeline graph "
"could not be serialized: ",
s.error_message()));
return;
}
// In case we allow stateful ops, we walk the graph and find all the stateful
// ops in the Graph. We then log a warning indicating what ops' state we are
// going to throw away.
Expand Down

0 comments on commit 02fa654

Please sign in to comment.