diff --git a/tensorflow/contrib/cloud/kernels/bigquery_table_accessor_test.cc b/tensorflow/contrib/cloud/kernels/bigquery_table_accessor_test.cc index 9fb339864d37913238547ce30572048e102cd9d0..4851d485cc60920731dc8f46a61027bcfa6aeab0 100644 --- a/tensorflow/contrib/cloud/kernels/bigquery_table_accessor_test.cc +++ b/tensorflow/contrib/cloud/kernels/bigquery_table_accessor_test.cc @@ -469,7 +469,7 @@ TEST_F(BigQueryTableAccessorTest, SwitchingPartitionsTest) { partition.set_start_index(3); partition.set_end_index(-1); - accessor_->SetPartition(partition); + TF_EXPECT_OK(accessor_->SetPartition(partition)); TF_EXPECT_OK(accessor_->ReadRow(&row_id, &example)); EXPECT_EQ(3, row_id); EXPECT_TRUE(accessor_->Done()); @@ -478,7 +478,7 @@ TEST_F(BigQueryTableAccessorTest, SwitchingPartitionsTest) { partition.set_start_index(0); partition.set_end_index(1); - accessor_->SetPartition(partition); + TF_EXPECT_OK(accessor_->SetPartition(partition)); TF_EXPECT_OK(accessor_->ReadRow(&row_id, &example)); EXPECT_EQ(0, row_id); EXPECT_FALSE(accessor_->Done()); diff --git a/tensorflow/core/kernels/remote_fused_graph_execute_op_test.cc b/tensorflow/core/kernels/remote_fused_graph_execute_op_test.cc index 2ded4b82f5822e8fee5f4f5591ab646490a90aa1..86eb8a03ccc9c68817fdcab7e8335159ef272aed 100644 --- a/tensorflow/core/kernels/remote_fused_graph_execute_op_test.cc +++ b/tensorflow/core/kernels/remote_fused_graph_execute_op_test.cc @@ -168,9 +168,10 @@ class TestRemoteFusedGraphExecutor final : public IRemoteFusedGraphExecutor { // TODO(satok): Read NAME_B from node_a_plus_b const NodeDef& node_b = *node_def_map_.at(NAME_B); const TensorProto* proto = nullptr; - GetNodeAttr(node_b, "value", &proto); + TF_CHECK_OK(GetNodeAttr(node_b, "value", &proto)); Tensor const_tensor; - RemoteFusedGraphExecuteUtils::MakeTensorFromProto(*proto, &const_tensor); + TF_CHECK_OK(RemoteFusedGraphExecuteUtils::MakeTensorFromProto( + *proto, &const_tensor)); const float b_val = *const_tensor.scalar().data(); Tensor output_a_plus_b(DT_FLOAT, {}); output_a_plus_b.flat().data()[0] = input_val + b_val; @@ -258,7 +259,7 @@ TEST(RemoteFusedExecuteGraphOp, EndToEndTest) { // 5.2 Fuse graph GraphDef fused_graph; - RewriteGraphToFusedGraph(original_graph, &fused_graph); + TF_CHECK_OK(RewriteGraphToFusedGraph(original_graph, &fused_graph)); // 5.3 Setup session std::vector output_tensors; diff --git a/tensorflow/core/kernels/remote_fused_graph_execute_utils.cc b/tensorflow/core/kernels/remote_fused_graph_execute_utils.cc index 480dced1c718d51eabe4507d13a16cfc9988f9f8..eacd18a793c19d67286b2c17856fe641000e4b8b 100644 --- a/tensorflow/core/kernels/remote_fused_graph_execute_utils.cc +++ b/tensorflow/core/kernels/remote_fused_graph_execute_utils.cc @@ -269,7 +269,8 @@ RemoteFusedGraphExecuteUtils::AddOutputTensorShapeTypeByTensorShapeMap( shape_inference::ShapeHandle handle; status = context->MakeShapeFromTensorShape( input_node_info.second.shape(), &handle); - shape_refiner->SetShape(node, 0, handle); + // TODO(b/32704451): Don't just ignore this status! + shape_refiner->SetShape(node, 0, handle).IgnoreError(); is_input_node = true; } if (!status.ok()) { diff --git a/tensorflow/core/kernels/remote_fused_graph_execute_utils_test.cc b/tensorflow/core/kernels/remote_fused_graph_execute_utils_test.cc index 099e1d42aa442ce2535301b0c3cdda933ae82a17..52afa5dde11cb9f38c479678ba6c58d216f69022 100644 --- a/tensorflow/core/kernels/remote_fused_graph_execute_utils_test.cc +++ b/tensorflow/core/kernels/remote_fused_graph_execute_utils_test.cc @@ -19,6 +19,7 @@ limitations under the License. #include "tensorflow/core/common_runtime/shape_refiner.h" #include "tensorflow/core/kernels/remote_fused_graph_execute_op_test_utils.h" #include "tensorflow/core/lib/core/status.h" +#include "tensorflow/core/lib/core/status_test_util.h" #include "tensorflow/core/platform/test.h" namespace tensorflow { @@ -188,34 +189,38 @@ TEST(RemoteFusedGraphExecuteUtils, PropagateAndBuildTensorShapeMap) { { NodeDef* node_def = GetNodeDef(NAME_B, &def); - RemoteFusedGraphExecuteUtils::AddOutputTensorShapeTypeByTensorShapeMap( - tensor_shape_map, node_def); + TF_ASSERT_OK( + RemoteFusedGraphExecuteUtils::AddOutputTensorShapeTypeByTensorShapeMap( + tensor_shape_map, node_def)); std::vector data_types; - GetNodeAttr(*node_def, RemoteFusedGraphExecuteUtils::ATTR_OUTPUT_DATA_TYPES, - &data_types); + TF_ASSERT_OK(GetNodeAttr( + *node_def, RemoteFusedGraphExecuteUtils::ATTR_OUTPUT_DATA_TYPES, + &data_types)); ASSERT_EQ(1, data_types.size()); EXPECT_EQ(DT_FLOAT, data_types.at(0)); std::vector shapes; - GetNodeAttr(*node_def, RemoteFusedGraphExecuteUtils::ATTR_OUTPUT_SHAPES, - &shapes); + TF_ASSERT_OK(GetNodeAttr( + *node_def, RemoteFusedGraphExecuteUtils::ATTR_OUTPUT_SHAPES, &shapes)); ASSERT_EQ(1, shapes.size()); EXPECT_EQ(0, shapes.at(0).dims()); } { NodeDef* node_def = GetNodeDef(NAME_A_PLUS_B, &def); - RemoteFusedGraphExecuteUtils::AddOutputTensorShapeTypeByTensorShapeMap( - tensor_shape_map, node_def); + TF_ASSERT_OK( + RemoteFusedGraphExecuteUtils::AddOutputTensorShapeTypeByTensorShapeMap( + tensor_shape_map, node_def)); std::vector data_types; - GetNodeAttr(*node_def, RemoteFusedGraphExecuteUtils::ATTR_OUTPUT_DATA_TYPES, - &data_types); + TF_ASSERT_OK(GetNodeAttr( + *node_def, RemoteFusedGraphExecuteUtils::ATTR_OUTPUT_DATA_TYPES, + &data_types)); ASSERT_EQ(1, data_types.size()); EXPECT_EQ(DT_FLOAT, data_types.at(0)); std::vector shapes; - GetNodeAttr(*node_def, RemoteFusedGraphExecuteUtils::ATTR_OUTPUT_SHAPES, - &shapes); + TF_ASSERT_OK(GetNodeAttr( + *node_def, RemoteFusedGraphExecuteUtils::ATTR_OUTPUT_SHAPES, &shapes)); ASSERT_EQ(1, shapes.size()); EXPECT_EQ(0, shapes.at(0).dims()); }