diff options
author | Manjunath Kudlur <keveman@gmail.com> | 2016-02-18 12:28:45 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-02-18 12:50:36 -0800 |
commit | 2f756013f5bcc39ee288eed9da8d27cf4ec16f7e (patch) | |
tree | 30da7df59601595a07c7fc6ef2c109a57a2e8f36 | |
parent | d0a822fbcb04d95a643d8efe65699a8d1cdce98b (diff) |
Enable deserializing protos > 64MB in length.
Update protobuf commit
Change: 114990608
m--------- | google/protobuf | 0 | ||||
-rw-r--r-- | tensorflow/python/BUILD | 11 | ||||
-rw-r--r-- | tensorflow/python/framework/proto_test.py | 40 | ||||
-rw-r--r-- | tensorflow/tensorboard/lib/js/backend/test/blaze.html | 17 | ||||
-rw-r--r-- | tensorflow/tensorboard/lib/js/nanite/test/blaze.html | 21 | ||||
-rw-r--r-- | tensorflow/tensorboard/lib/js/requestManager/test/blaze.html | 13 | ||||
-rw-r--r-- | tools/bazel.rc.template | 1 |
7 files changed, 52 insertions, 51 deletions
diff --git a/google/protobuf b/google/protobuf -Subproject caf1fb7197ee94c07108fc7cfbca07432b185a2 +Subproject c40f8c1f54f028b1ca73f3fb2dfdde500f94918 diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD index 312868cd75..eec19daf3b 100644 --- a/tensorflow/python/BUILD +++ b/tensorflow/python/BUILD @@ -251,6 +251,17 @@ py_test( ], ) +py_test( + name = "proto_test", + srcs = ["framework/proto_test.py"], + main = "framework/proto_test.py", + srcs_version = "PY2AND3", + deps = [ + ":framework_test_lib", + "//tensorflow:tensorflow_py", + ], +) + tf_gen_op_wrapper_py( name = "functional_ops", out = "ops/gen_functional_ops.py", diff --git a/tensorflow/python/framework/proto_test.py b/tensorflow/python/framework/proto_test.py new file mode 100644 index 0000000000..67372253b0 --- /dev/null +++ b/tensorflow/python/framework/proto_test.py @@ -0,0 +1,40 @@ +# Copyright 2015 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== +"""Protobuf related tests.""" + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import numpy as np +import tensorflow as tf + +class ProtoTest(tf.test.TestCase): + + def testLargeProto(self): + # create a constant of size > 64MB. + a = tf.constant(np.zeros([1024, 1024, 17])) + # Serialize the resulting graph def. + gdef = a.op.graph.as_graph_def() + serialized = gdef.SerializeToString() + unserialized = tf.Graph().as_graph_def() + # Deserialize back. Protobuf python library should support + # protos larger than 64MB. + unserialized.ParseFromString(serialized) + self.assertProtoEquals(unserialized, gdef) + + +if __name__ == "__main__": + tf.test.main() diff --git a/tensorflow/tensorboard/lib/js/backend/test/blaze.html b/tensorflow/tensorboard/lib/js/backend/test/blaze.html deleted file mode 100644 index e5a37e870a..0000000000 --- a/tensorflow/tensorboard/lib/js/backend/test/blaze.html +++ /dev/null @@ -1,17 +0,0 @@ -<!doctype html> -<html> -<!-- This test file has import paths that load correctly in automated build. --> -<head> - <meta charset="utf-8"> - <script src="../../../../../webcomponentsjs/webcomponents-lite.min.js"></script> - <script src="../../../../components/web-component-tester/browser.js"></script> - -</head> -<body> - <script src="../../requestManager/requestManager.js"></script> - <script src="../urlPathHelpers.js"></script> - <script src="../backendImplementation.js"></script> - <script src="../backend.js"></script> - <script src="backendTests.js"></script> -</body> -</html> diff --git a/tensorflow/tensorboard/lib/js/nanite/test/blaze.html b/tensorflow/tensorboard/lib/js/nanite/test/blaze.html deleted file mode 100644 index 50e08c19cf..0000000000 --- a/tensorflow/tensorboard/lib/js/nanite/test/blaze.html +++ /dev/null @@ -1,21 +0,0 @@ -<!doctype html> -<!-- This test file has import paths that work in automated build tooling. --> -<html> -<head> - <meta charset="utf-8"> - <script src="../../../../../webcomponentsjs/webcomponents-lite.min.js"></script> - <script src="../../../../components/web-component-tester/browser.js"></script> - <link rel="import" href="../../../../../polymer/polymer.html"> - -</head> -<body> - <script src="../nanite.js"></script> - <script src="naniteTest.js"></script> - <test-fixture id="testElementFixture"> - <template> - <test-element id="test"></test-element> - </template> - </test-fixture> - -</body> -</html> diff --git a/tensorflow/tensorboard/lib/js/requestManager/test/blaze.html b/tensorflow/tensorboard/lib/js/requestManager/test/blaze.html deleted file mode 100644 index 1bcda50651..0000000000 --- a/tensorflow/tensorboard/lib/js/requestManager/test/blaze.html +++ /dev/null @@ -1,13 +0,0 @@ -<!doctype html> -<html> -<head> - <!-- This test file has import paths that work in automated build tooling. --> - <meta charset="utf-8"> - <script src="../../../../../webcomponentsjs/webcomponents-lite.min.js"></script> - <script src="../../../../components/web-component-tester/browser.js"></script> -</head> -<body> - <script src="../requestManager.js"></script> - <script src="requestManagerTest.js"></script> -</body> -</html> diff --git a/tools/bazel.rc.template b/tools/bazel.rc.template index b49fd62306..5bdc9884e8 100644 --- a/tools/bazel.rc.template +++ b/tools/bazel.rc.template @@ -3,6 +3,7 @@ build:cuda --crosstool_top=//third_party/gpus/crosstool build --force_python=py$PYTHON_MAJOR_VERSION build --python$PYTHON_MAJOR_VERSION_path=$PYTHON_BINARY build --define=use_fast_cpp_protos=true +build --define=allow_oversize_protos=true build --spawn_strategy=standalone test --spawn_strategy=standalone |