Always imports the contrib summary ops when importing tensorflow.
authorAlexandre Passos <apassos@google.com>
Tue, 20 Mar 2018 03:21:45 +0000 (20:21 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Tue, 20 Mar 2018 03:25:38 +0000 (20:25 -0700)
Fixes #17802

PiperOrigin-RevId: 189684619

31 files changed:
tensorflow/contrib/cmake/tf_python.cmake
tensorflow/contrib/summary/BUILD
tensorflow/contrib/summary/summary_ops.py
tensorflow/core/BUILD
tensorflow/core/api_def/base_api/api_def_CloseSummaryWriter.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/base_api/api_def_CreateSummaryDbWriter.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/base_api/api_def_CreateSummaryFileWriter.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/base_api/api_def_FlushSummaryWriter.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/base_api/api_def_ImportEvent.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/base_api/api_def_SummaryWriter.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/base_api/api_def_WriteAudioSummary.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/base_api/api_def_WriteGraphSummary.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/base_api/api_def_WriteHistogramSummary.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/base_api/api_def_WriteImageSummary.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/base_api/api_def_WriteScalarSummary.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/base_api/api_def_WriteSummary.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/python_api/api_def_CloseSummaryWriter.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/python_api/api_def_CreateSummaryDbWriter.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/python_api/api_def_CreateSummaryFileWriter.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/python_api/api_def_FlushSummaryWriter.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/python_api/api_def_ImportEvent.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/python_api/api_def_SummaryWriter.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/python_api/api_def_WriteAudioSummary.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/python_api/api_def_WriteGraphSummary.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/python_api/api_def_WriteHistogramSummary.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/python_api/api_def_WriteImageSummary.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/python_api/api_def_WriteScalarSummary.pbtxt [new file with mode: 0644]
tensorflow/core/api_def/python_api/api_def_WriteSummary.pbtxt [new file with mode: 0644]
tensorflow/core/ops/summary_ops.cc
tensorflow/python/BUILD
tensorflow/python/summary/summary.py

index b730ebd..1e354bf 100755 (executable)
@@ -348,6 +348,7 @@ GENERATE_PYTHON_OP_LIB("state_ops")
 GENERATE_PYTHON_OP_LIB("sparse_ops")
 GENERATE_PYTHON_OP_LIB("spectral_ops")
 GENERATE_PYTHON_OP_LIB("string_ops")
+GENERATE_PYTHON_OP_LIB("summary_ops")
 GENERATE_PYTHON_OP_LIB("user_ops")
 GENERATE_PYTHON_OP_LIB("training_ops"
   DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/tf_python/tensorflow/python/training/gen_training_ops.py)
@@ -419,8 +420,6 @@ GENERATE_PYTHON_OP_LIB("stateless_random_ops"
   DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/tf_python/tensorflow/contrib/stateless/gen_stateless_random_ops.py)
 GENERATE_PYTHON_OP_LIB("debug_ops"
   DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/tf_python/tensorflow/python/debug/ops/gen_debug_ops.py)
-GENERATE_PYTHON_OP_LIB("summary_ops"
-  DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/tf_python/tensorflow/contrib/summary/gen_summary_ops.py)
 
 add_custom_target(tf_python_ops SOURCES ${tf_python_ops_generated_files} ${PYTHON_PROTO_GENFILES})
 add_dependencies(tf_python_ops tf_python_op_gen_main)
index b58c83f..80563c5 100644 (file)
@@ -10,12 +10,6 @@ load(
     "tf_gen_op_wrapper_py",
 )
 
-tf_gen_op_wrapper_py(
-    name = "gen_summary_ops",
-    out = "gen_summary_ops.py",
-    deps = ["//tensorflow/core:summary_ops_op_lib"],
-)
-
 py_test(
     name = "summary_ops_test",
     srcs = ["summary_ops_test.py"],
@@ -61,7 +55,6 @@ py_library(
     srcs_version = "PY2AND3",
     visibility = ["//tensorflow:internal"],
     deps = [
-        ":gen_summary_ops",
         "//tensorflow/core:protos_all_py",
         "//tensorflow/python:array_ops",
         "//tensorflow/python:constant_op",
@@ -72,6 +65,7 @@ py_library(
         "//tensorflow/python:math_ops",
         "//tensorflow/python:resource_variable_ops",
         "//tensorflow/python:summary_op_util",
+        "//tensorflow/python:summary_ops_gen",
         "//tensorflow/python:training",
         "//tensorflow/python:util",
         "//tensorflow/python/eager:context",
index c1724c6..bc763fe 100644 (file)
@@ -26,7 +26,6 @@ import time
 
 import six
 
-from tensorflow.contrib.summary import gen_summary_ops
 from tensorflow.core.framework import graph_pb2
 from tensorflow.python.eager import context
 from tensorflow.python.framework import constant_op
@@ -35,6 +34,7 @@ from tensorflow.python.framework import ops
 from tensorflow.python.layers import utils
 from tensorflow.python.ops import array_ops
 from tensorflow.python.ops import control_flow_ops
+from tensorflow.python.ops import gen_summary_ops
 from tensorflow.python.ops import math_ops
 from tensorflow.python.ops import resource_variable_ops
 from tensorflow.python.ops import summary_op_util
index 1d283e2..8124280 100644 (file)
@@ -722,6 +722,7 @@ cc_library(
         ":sendrecv_ops_op_lib",
         ":set_ops_op_lib",
         ":sparse_ops_op_lib",
+        ":summary_ops_op_lib",
         ":spectral_ops_op_lib",
         ":state_ops_op_lib",
         ":stateless_random_ops_op_lib",
diff --git a/tensorflow/core/api_def/base_api/api_def_CloseSummaryWriter.pbtxt b/tensorflow/core/api_def/base_api/api_def_CloseSummaryWriter.pbtxt
new file mode 100644 (file)
index 0000000..f6fd7d9
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "CloseSummaryWriter"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/base_api/api_def_CreateSummaryDbWriter.pbtxt b/tensorflow/core/api_def/base_api/api_def_CreateSummaryDbWriter.pbtxt
new file mode 100644 (file)
index 0000000..28da46a
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "CreateSummaryDbWriter"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/base_api/api_def_CreateSummaryFileWriter.pbtxt b/tensorflow/core/api_def/base_api/api_def_CreateSummaryFileWriter.pbtxt
new file mode 100644 (file)
index 0000000..2ce2c4d
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "CreateSummaryFileWriter"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/base_api/api_def_FlushSummaryWriter.pbtxt b/tensorflow/core/api_def/base_api/api_def_FlushSummaryWriter.pbtxt
new file mode 100644 (file)
index 0000000..3ada43c
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "FlushSummaryWriter"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/base_api/api_def_ImportEvent.pbtxt b/tensorflow/core/api_def/base_api/api_def_ImportEvent.pbtxt
new file mode 100644 (file)
index 0000000..d8813b5
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "ImportEvent"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/base_api/api_def_SummaryWriter.pbtxt b/tensorflow/core/api_def/base_api/api_def_SummaryWriter.pbtxt
new file mode 100644 (file)
index 0000000..1fe57ec
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "SummaryWriter"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/base_api/api_def_WriteAudioSummary.pbtxt b/tensorflow/core/api_def/base_api/api_def_WriteAudioSummary.pbtxt
new file mode 100644 (file)
index 0000000..520952c
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "WriteAudioSummary"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/base_api/api_def_WriteGraphSummary.pbtxt b/tensorflow/core/api_def/base_api/api_def_WriteGraphSummary.pbtxt
new file mode 100644 (file)
index 0000000..3653477
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "WriteGraphSummary"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/base_api/api_def_WriteHistogramSummary.pbtxt b/tensorflow/core/api_def/base_api/api_def_WriteHistogramSummary.pbtxt
new file mode 100644 (file)
index 0000000..26e1482
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "WriteHistogramSummary"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/base_api/api_def_WriteImageSummary.pbtxt b/tensorflow/core/api_def/base_api/api_def_WriteImageSummary.pbtxt
new file mode 100644 (file)
index 0000000..78db870
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "WriteImageSummary"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/base_api/api_def_WriteScalarSummary.pbtxt b/tensorflow/core/api_def/base_api/api_def_WriteScalarSummary.pbtxt
new file mode 100644 (file)
index 0000000..7bae863
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "WriteScalarSummary"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/base_api/api_def_WriteSummary.pbtxt b/tensorflow/core/api_def/base_api/api_def_WriteSummary.pbtxt
new file mode 100644 (file)
index 0000000..db86883
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "WriteSummary"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/python_api/api_def_CloseSummaryWriter.pbtxt b/tensorflow/core/api_def/python_api/api_def_CloseSummaryWriter.pbtxt
new file mode 100644 (file)
index 0000000..f6fd7d9
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "CloseSummaryWriter"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/python_api/api_def_CreateSummaryDbWriter.pbtxt b/tensorflow/core/api_def/python_api/api_def_CreateSummaryDbWriter.pbtxt
new file mode 100644 (file)
index 0000000..28da46a
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "CreateSummaryDbWriter"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/python_api/api_def_CreateSummaryFileWriter.pbtxt b/tensorflow/core/api_def/python_api/api_def_CreateSummaryFileWriter.pbtxt
new file mode 100644 (file)
index 0000000..2ce2c4d
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "CreateSummaryFileWriter"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/python_api/api_def_FlushSummaryWriter.pbtxt b/tensorflow/core/api_def/python_api/api_def_FlushSummaryWriter.pbtxt
new file mode 100644 (file)
index 0000000..3ada43c
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "FlushSummaryWriter"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/python_api/api_def_ImportEvent.pbtxt b/tensorflow/core/api_def/python_api/api_def_ImportEvent.pbtxt
new file mode 100644 (file)
index 0000000..d8813b5
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "ImportEvent"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/python_api/api_def_SummaryWriter.pbtxt b/tensorflow/core/api_def/python_api/api_def_SummaryWriter.pbtxt
new file mode 100644 (file)
index 0000000..1fe57ec
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "SummaryWriter"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/python_api/api_def_WriteAudioSummary.pbtxt b/tensorflow/core/api_def/python_api/api_def_WriteAudioSummary.pbtxt
new file mode 100644 (file)
index 0000000..520952c
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "WriteAudioSummary"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/python_api/api_def_WriteGraphSummary.pbtxt b/tensorflow/core/api_def/python_api/api_def_WriteGraphSummary.pbtxt
new file mode 100644 (file)
index 0000000..3653477
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "WriteGraphSummary"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/python_api/api_def_WriteHistogramSummary.pbtxt b/tensorflow/core/api_def/python_api/api_def_WriteHistogramSummary.pbtxt
new file mode 100644 (file)
index 0000000..26e1482
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "WriteHistogramSummary"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/python_api/api_def_WriteImageSummary.pbtxt b/tensorflow/core/api_def/python_api/api_def_WriteImageSummary.pbtxt
new file mode 100644 (file)
index 0000000..78db870
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "WriteImageSummary"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/python_api/api_def_WriteScalarSummary.pbtxt b/tensorflow/core/api_def/python_api/api_def_WriteScalarSummary.pbtxt
new file mode 100644 (file)
index 0000000..7bae863
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "WriteScalarSummary"
+  visibility: HIDDEN
+}
diff --git a/tensorflow/core/api_def/python_api/api_def_WriteSummary.pbtxt b/tensorflow/core/api_def/python_api/api_def_WriteSummary.pbtxt
new file mode 100644 (file)
index 0000000..db86883
--- /dev/null
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "WriteSummary"
+  visibility: HIDDEN
+}
index aa7458f..742a221 100644 (file)
@@ -22,15 +22,7 @@ REGISTER_OP("SummaryWriter")
     .Output("writer: resource")
     .Attr("shared_name: string = ''")
     .Attr("container: string = ''")
-    .SetShapeFn(shape_inference::ScalarShape)
-    .Doc(R"doc(
-Returns a handle to be used to access a summary writer.
-
-The summary writer is an in-graph resource which can be used by ops to write
-summaries to event files.
-
-writer: the summary writer resource. Scalar handle.
-)doc");
+    .SetShapeFn(shape_inference::ScalarShape);
 
 REGISTER_OP("CreateSummaryFileWriter")
     .Input("writer: resource")
@@ -38,17 +30,7 @@ REGISTER_OP("CreateSummaryFileWriter")
     .Input("max_queue: int32")
     .Input("flush_millis: int32")
     .Input("filename_suffix: string")
-    .SetShapeFn(shape_inference::NoOutputs)
-    .Doc(R"doc(
-Creates a summary file writer accessible by the given resource handle.
-
-writer: A handle to the summary writer resource
-logdir: Directory where the event file will be written.
-max_queue: Size of the queue of pending events and summaries.
-flush_millis: How often, in milliseconds, to flush the pending events and
-  summaries to disk.
-filename_suffix: Every event file's name is suffixed with this suffix.
-)doc");
+    .SetShapeFn(shape_inference::NoOutputs);
 
 REGISTER_OP("CreateSummaryDbWriter")
     .Input("writer: resource")
@@ -56,47 +38,15 @@ REGISTER_OP("CreateSummaryDbWriter")
     .Input("experiment_name: string")
     .Input("run_name: string")
     .Input("user_name: string")
-    .SetShapeFn(shape_inference::NoOutputs)
-    .Doc(R"doc(
-Creates summary database writer accessible by given resource handle.
-
-This can be used to write tensors from the execution graph directly
-to a database. Only SQLite is supported right now. This function
-will create the schema if it doesn't exist. Entries in the Users,
-Experiments, and Runs tables will be created automatically if they
-don't already exist.
-
-writer: Handle to SummaryWriter resource to overwrite.
-db_uri: For example "file:/tmp/foo.sqlite".
-experiment_name: Can't contain ASCII control characters or <>. Case
-  sensitive. If empty, then the Run will not be associated with any
-  Experiment.
-run_name: Can't contain ASCII control characters or <>. Case sensitive.
-  If empty, then each Tag will not be associated with any Run.
-user_name: Must be valid as both a DNS label and Linux username. If
-  empty, then the Experiment will not be associated with any User.
-)doc");
+    .SetShapeFn(shape_inference::NoOutputs);
 
 REGISTER_OP("FlushSummaryWriter")
     .Input("writer: resource")
-    .SetShapeFn(shape_inference::NoOutputs)
-    .Doc(R"(
-Flushes the writer's unwritten events.
-
-writer: A handle to the summary writer resource.
-)");
+    .SetShapeFn(shape_inference::NoOutputs);
 
 REGISTER_OP("CloseSummaryWriter")
     .Input("writer: resource")
-    .SetShapeFn(shape_inference::NoOutputs)
-    .Doc(R"(
-Flushes and closes the summary writer.
-
-Also removes it from the resource manager. To reopen, use another
-CreateSummaryFileWriter op.
-
-writer: A handle to the summary writer resource.
-)");
+    .SetShapeFn(shape_inference::NoOutputs);
 
 REGISTER_OP("WriteSummary")
     .Input("writer: resource")
@@ -105,31 +55,12 @@ REGISTER_OP("WriteSummary")
     .Input("tag: string")
     .Input("summary_metadata: string")
     .Attr("T: type")
-    .SetShapeFn(shape_inference::NoOutputs)
-    .Doc(R"doc(
-Outputs a `Summary` protocol buffer with a tensor.
-
-writer: A handle to a summary writer.
-step: The step to write the summary for.
-tensor: A tensor to serialize.
-tag: The summary's tag.
-summary_metadata: Serialized SummaryMetadata protocol buffer containing
- plugin-related metadata for this summary.
-)doc");
+    .SetShapeFn(shape_inference::NoOutputs);
 
 REGISTER_OP("ImportEvent")
     .Input("writer: resource")
     .Input("event: string")
-    .SetShapeFn(shape_inference::NoOutputs)
-    .Doc(R"doc(
-Outputs a `tf.Event` protocol buffer.
-
-When CreateSummaryDbWriter is being used, this op can be useful for
-importing data from event logs.
-
-writer: A handle to a summary writer.
-event: A string containing a binary-encoded tf.Event proto.
-)doc");
+    .SetShapeFn(shape_inference::NoOutputs);
 
 REGISTER_OP("WriteScalarSummary")
     .Input("writer: resource")
@@ -137,17 +68,7 @@ REGISTER_OP("WriteScalarSummary")
     .Input("tag: string")
     .Input("value: T")
     .Attr("T: realnumbertype")
-    .SetShapeFn(shape_inference::NoOutputs)
-    .Doc(R"doc(
-Writes a `Summary` protocol buffer with scalar values.
-
-The input `tag` and `value` must have the scalars.
-
-writer: A handle to a summary writer.
-step: The step to write the summary for.
-tag: Tag for the summary.
-value: Value for the summary.
-)doc");
+    .SetShapeFn(shape_inference::NoOutputs);
 
 REGISTER_OP("WriteHistogramSummary")
     .Input("writer: resource")
@@ -155,21 +76,7 @@ REGISTER_OP("WriteHistogramSummary")
     .Input("tag: string")
     .Input("values: T")
     .Attr("T: realnumbertype = DT_FLOAT")
-    .SetShapeFn(shape_inference::NoOutputs)
-    .Doc(R"doc(
-Writes a `Summary` protocol buffer with a histogram.
-
-The generated
-[`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto)
-has one summary value containing a histogram for `values`.
-
-This op reports an `InvalidArgument` error if any value is not finite.
-
-writer: A handle to a summary writer.
-step: The step to write the summary for.
-tag: Scalar.  Tag to use for the `Summary.Value`.
-values: Any shape. Values to use to build the histogram.
-)doc");
+    .SetShapeFn(shape_inference::NoOutputs);
 
 REGISTER_OP("WriteImageSummary")
     .Input("writer: resource")
@@ -179,52 +86,7 @@ REGISTER_OP("WriteImageSummary")
     .Input("bad_color: uint8")
     .Attr("max_images: int >= 1 = 3")
     .Attr("T: {uint8, float, half} = DT_FLOAT")
-    .SetShapeFn(shape_inference::NoOutputs)
-    .Doc(R"doc(
-Writes a `Summary` protocol buffer with images.
-
-The summary has up to `max_images` summary values containing images. The
-images are built from `tensor` which must be 4-D with shape `[batch_size,
-height, width, channels]` and where `channels` can be:
-
-*  1: `tensor` is interpreted as Grayscale.
-*  3: `tensor` is interpreted as RGB.
-*  4: `tensor` is interpreted as RGBA.
-
-The images have the same number of channels as the input tensor. For float
-input, the values are normalized one image at a time to fit in the range
-`[0, 255]`.  `uint8` values are unchanged.  The op uses two different
-normalization algorithms:
-
-*  If the input values are all positive, they are rescaled so the largest one
-   is 255.
-
-*  If any input value is negative, the values are shifted so input value 0.0
-   is at 127.  They are then rescaled so that either the smallest value is 0,
-   or the largest one is 255.
-
-The `tag` argument is a scalar `Tensor` of type `string`.  It is used to
-build the `tag` of the summary values:
-
-*  If `max_images` is 1, the summary value tag is '*tag*/image'.
-*  If `max_images` is greater than 1, the summary value tags are
-   generated sequentially as '*tag*/image/0', '*tag*/image/1', etc.
-
-The `bad_color` argument is the color to use in the generated images for
-non-finite input values.  It is a `unit8` 1-D tensor of length `channels`.
-Each element must be in the range `[0, 255]` (It represents the value of a
-pixel in the output image).  Non-finite values in the input tensor are
-replaced by this tensor in the output image.  The default value is the color
-red.
-
-writer: A handle to a summary writer.
-step: The step to write the summary for.
-tag: Scalar. Used to build the `tag` attribute of the summary values.
-tensor: 4-D of shape `[batch_size, height, width, channels]` where
-  `channels` is 1, 3, or 4.
-max_images: Max number of batch elements to generate images for.
-bad_color: Color to use for pixels with non-finite values.
-)doc");
+    .SetShapeFn(shape_inference::NoOutputs);
 
 REGISTER_OP("WriteAudioSummary")
     .Input("writer: resource")
@@ -233,41 +95,12 @@ REGISTER_OP("WriteAudioSummary")
     .Input("tensor: float")
     .Input("sample_rate: float")
     .Attr("max_outputs: int >= 1 = 3")
-    .SetShapeFn(shape_inference::NoOutputs)
-    .Doc(R"doc(
-Writes a `Summary` protocol buffer with audio.
-
-The summary has up to `max_outputs` summary values containing audio. The
-audio is built from `tensor` which must be 3-D with shape `[batch_size,
-frames, channels]` or 2-D with shape `[batch_size, frames]`. The values are
-assumed to be in the range of `[-1.0, 1.0]` with a sample rate of `sample_rate`.
-
-The `tag` argument is a scalar `Tensor` of type `string`.  It is used to
-build the `tag` of the summary values:
-
-*  If `max_outputs` is 1, the summary value tag is '*tag*/audio'.
-*  If `max_outputs` is greater than 1, the summary value tags are
-   generated sequentially as '*tag*/audio/0', '*tag*/audio/1', etc.
-
-writer: A handle to a summary writer.
-step: The step to write the summary for.
-tag: Scalar. Used to build the `tag` attribute of the summary values.
-tensor: 2-D of shape `[batch_size, frames]`.
-sample_rate: The sample rate of the signal in hertz.
-max_outputs: Max number of batch elements to generate audio for.
-)doc");
+    .SetShapeFn(shape_inference::NoOutputs);
 
 REGISTER_OP("WriteGraphSummary")
     .Input("writer: resource")
     .Input("step: int64")
     .Input("tensor: string")
-    .SetShapeFn(shape_inference::NoOutputs)
-    .Doc(R"doc(
-Writes a `GraphDef` protocol buffer to a `SummaryWriter`.
-
-writer: Handle of `SummaryWriter`.
-step: The step to write the summary for.
-tensor: A scalar string of the serialized tf.GraphDef proto.
-)doc");
+    .SetShapeFn(shape_inference::NoOutputs);
 
 }  // namespace tensorflow
index ec67f43..7ece482 100644 (file)
@@ -1359,6 +1359,12 @@ tf_gen_op_wrapper_private_py(
 )
 
 tf_gen_op_wrapper_private_py(
+    name = "summary_ops_gen",
+    visibility = ["//tensorflow:__subpackages__"],
+    deps = ["//tensorflow/core:summary_ops_op_lib"],
+)
+
+tf_gen_op_wrapper_private_py(
     name = "audio_ops_gen",
     require_shape_functions = True,
     visibility = [
@@ -4110,6 +4116,7 @@ py_library(
         ":pywrap_tensorflow",
         ":summary_op_util",
         ":summary_ops",
+        ":summary_ops_gen",
         ":util",
         "//tensorflow/python/eager:context",
         "//third_party/py/numpy",
index f1b2be0..97f2ddf 100644 (file)
@@ -48,10 +48,12 @@ from tensorflow.core.util.event_pb2 import SessionLog
 from tensorflow.core.util.event_pb2 import TaggedRunMetadata
 # pylint: enable=unused-import
 
+
 from tensorflow.python.eager import context as _context
 from tensorflow.python.framework import dtypes as _dtypes
 from tensorflow.python.framework import ops as _ops
 from tensorflow.python.ops import gen_logging_ops as _gen_logging_ops
+from tensorflow.python.ops import gen_summary_ops as _gen_summary_ops  # pylint: disable=unused-import
 from tensorflow.python.ops import summary_op_util as _summary_op_util
 
 # exports tensor-related summaries