diff --git a/tensorflow/core/framework/graph_def_util_test.cc b/tensorflow/core/framework/graph_def_util_test.cc index dacfab93e9f9a2908dd981d8338e1ec456fbb715..1b12323e9a613ba7c202cacfd2fd6fe344a29302 100644 --- a/tensorflow/core/framework/graph_def_util_test.cc +++ b/tensorflow/core/framework/graph_def_util_test.cc @@ -246,7 +246,7 @@ TEST(StrippedOpListForGraphTest, FlatTest) { FunctionDef* function_def = graph_def.mutable_library()->add_function(); function_def->mutable_signature()->set_name("F"); for (const string& op : graph_ops[order]) { - function_def->add_node()->set_op(op); + function_def->add_node_def()->set_op(op); } graph_def.add_node()->set_op("F"); } else { @@ -293,11 +293,11 @@ TEST(StrippedOpListForGraphTest, NestedFunctionTest) { FunctionDef* c = graph_def.mutable_library()->add_function(); b->mutable_signature()->set_name("B"); c->mutable_signature()->set_name("C"); - b->add_node()->set_op("A"); - c->add_node()->set_op("B"); + b->add_node_def()->set_op("A"); + c->add_node_def()->set_op("B"); if (recursive) { - b->add_node()->set_op("B"); - c->add_node()->set_op("C"); + b->add_node_def()->set_op("B"); + c->add_node_def()->set_op("C"); } // Use C in the graph. diff --git a/tensorflow/core/kernels/BUILD b/tensorflow/core/kernels/BUILD index fd7265e4ed2c327b41ed05756fec8203c781a024..19d28162f8338ac4ddd557349e7018b3cd025860 100644 --- a/tensorflow/core/kernels/BUILD +++ b/tensorflow/core/kernels/BUILD @@ -18,7 +18,7 @@ licenses(["notice"]) # Apache 2.0 package_group( name = "friends", packages = [ - "//learning/deepmind/tensorflow/...", + "//learning/deepmind/...", "//tensorflow/...", ], ) diff --git a/tensorflow/core/kernels/lookup_table_init_op.cc b/tensorflow/core/kernels/lookup_table_init_op.cc index 016f5d794f7689367f063da999e1f0e244a395e1..7d587ea13c39a4d8ef96d741cb0dfc5a1d230940 100644 --- a/tensorflow/core/kernels/lookup_table_init_op.cc +++ b/tensorflow/core/kernels/lookup_table_init_op.cc @@ -177,7 +177,7 @@ class TextFileLineIterator return; } if (next_id_ >= vocab_size_) { - LOG(WARNING) << "Truncated " << filename_ << " before it's end at " + LOG(WARNING) << "Truncated " << filename_ << " before its end at " << vocab_size_ << " records."; LOG(WARNING) << "next_id_ : " << next_id_; status_ = errors::OutOfRange("Finished reading ", vocab_size_, diff --git a/tensorflow/python/summary/event_accumulator.py b/tensorflow/python/summary/event_accumulator.py index 003c0d84d5c0911ba1dda30d9e0a8c7788289f7b..024475cc7601acc1c20a5d3f55fbf79e044f462d 100644 --- a/tensorflow/python/summary/event_accumulator.py +++ b/tensorflow/python/summary/event_accumulator.py @@ -709,7 +709,10 @@ def _CompressHistogram(histo_ev, bps): # See also: Histogram::Percentile() in core/lib/histogram/histogram.cc histo = histo_ev.histogram_value if not histo.num: - return [CompressedHistogramValue(b, 0.0) for b in bps] + return CompressedHistogramEvent( + histo_ev.wall_time, + histo_ev.step, + [CompressedHistogramValue(b, 0.0) for b in bps]) bucket = np.array(histo.bucket) weights = (bucket * bps[-1] / (bucket.sum() or 1.0)).cumsum() values = [] diff --git a/tensorflow/python/summary/event_accumulator_test.py b/tensorflow/python/summary/event_accumulator_test.py index 2fe96a40e4cd5af7f3888ac634e94eb9e3e15ec6..2ef12f97f2417e487ba6eddcb568d0bc6de9ad0d 100644 --- a/tensorflow/python/summary/event_accumulator_test.py +++ b/tensorflow/python/summary/event_accumulator_test.py @@ -351,6 +351,32 @@ class MockingEventAccumulatorTest(EventAccumulatorTest): wall_time=2, step=12, compressed_histogram_values=expected_vals2) self.assertEqual(acc.CompressedHistograms('hst2'), [expected_cmphst2]) + def testCompressedHistogramsWithEmptyHistogram(self): + gen = _EventGenerator() + acc = ea.EventAccumulator(gen, compression_bps=(0, 2500, 5000, 7500, 10000)) + + gen.AddHistogram( + 'hst1', + wall_time=1, + step=10, + hmin=None, + hmax=None, + hnum=0, + hsum=0, + hsum_squares=0, + hbucket_limit=[1, 2, 3], + hbucket=[0, 0, 0]) + acc.Reload() + + # Create the expected values after compressing hst1 + expected_vals1 = [ + ea.CompressedHistogramValue(bp, val) + for bp, val in [(0, 0.0), (2500, 0), (5000, 0), (7500, 0), (10000, 0)] + ] + expected_cmphst1 = ea.CompressedHistogramEvent( + wall_time=1, step=10, compressed_histogram_values=expected_vals1) + self.assertEqual(acc.CompressedHistograms('hst1'), [expected_cmphst1]) + def testCompressHistogram_uglyHistogram(self): bps = (0, 668, 1587, 3085, 5000, 6915, 8413, 9332, 10000) histogram_values = ea.HistogramValue(