diff options
author | Mark Heffernan <meheff@google.com> | 2017-01-19 10:31:30 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-01-19 10:45:19 -0800 |
commit | 6149fc54f4567cb00619fe085a691e3513343faf (patch) | |
tree | 3717073e5533e99e4b9bca674a36c170b9f3e3f9 /tensorflow/compiler/xla/service/gpu/pad_insertion.cc | |
parent | 6bbd60ca09e95dcd18e1a0d129c62ece1ab3b396 (diff) |
Don't remove send, recv, or trace instructions in DCE pass. Also,
opportunistically change HloComputation::Remove*,
HloComputation::Replace*, and HloInstruction::Replace* to return Status.
An error Status is returned if one of those instruction types (send, etc)
is removed.
Change: 144978731
Diffstat (limited to 'tensorflow/compiler/xla/service/gpu/pad_insertion.cc')
-rw-r--r-- | tensorflow/compiler/xla/service/gpu/pad_insertion.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tensorflow/compiler/xla/service/gpu/pad_insertion.cc b/tensorflow/compiler/xla/service/gpu/pad_insertion.cc index ca70d55fab..c645e84aa4 100644 --- a/tensorflow/compiler/xla/service/gpu/pad_insertion.cc +++ b/tensorflow/compiler/xla/service/gpu/pad_insertion.cc @@ -161,10 +161,10 @@ bool PadInsertion::CanonicalizeForwardConvolution(HloInstruction* conv) { dim->set_base_dilation(1); dim->set_window_dilation(1); } - conv->parent()->ReplaceWithNewInstruction( + TF_CHECK_OK(conv->parent()->ReplaceWithNewInstruction( conv, HloInstruction::CreateConvolve( conv->shape(), new_input, new_kernel, new_conv_window, - conv->convolution_dimension_numbers())); + conv->convolution_dimension_numbers()))); return true; } @@ -273,7 +273,8 @@ bool PadInsertion::CanonicalizeBackwardFilterConvolution( {new_transpose, new_forward_conv}, HloInstruction::FusionKind::kConvBackwardFilter, new_backward_conv_window, backward_conv_dnums); - computation->ReplaceInstruction(backward_conv, new_backward_conv); + TF_CHECK_OK( + computation->ReplaceInstruction(backward_conv, new_backward_conv)); return true; } @@ -375,10 +376,10 @@ bool PadInsertion::CanonicalizeBackwardInputConvolution( limit_indices) .ConsumeValueOrDie(), backward_conv->shape())); - computation->ReplaceWithNewInstruction( + TF_CHECK_OK(computation->ReplaceWithNewInstruction( backward_conv, HloInstruction::CreateSlice(backward_conv->shape(), new_backward_conv, - start_indices, limit_indices)); + start_indices, limit_indices))); return true; } |