aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2016-08-22 10:02:12 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-08-22 11:18:03 -0700
commit9d16661af2116e22175b6403f088c7f2e86d4b0d (patch)
treebde06ab3795cd88249a734045e7500cb5dffb201
parent2275acef9b0a36df72efd088993d17ba6fdbd8e6 (diff)
Increase bytes limit in ParseFrom().
Change: 130957917
-rw-r--r--tensorflow/core/distributed_runtime/tensor_coding.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/tensorflow/core/distributed_runtime/tensor_coding.cc b/tensorflow/core/distributed_runtime/tensor_coding.cc
index b0bf4e8aa7..24c2608ef4 100644
--- a/tensorflow/core/distributed_runtime/tensor_coding.cc
+++ b/tensorflow/core/distributed_runtime/tensor_coding.cc
@@ -75,9 +75,12 @@ void TensorResponse::InitPartial(const RecvTensorResponse& response) {
Status TensorResponse::ParseFrom(Source* source) {
if (!on_host_) {
+ protobuf::io::CodedInputStream input(source->contents());
+ input.SetTotalBytesLimit(INT_MAX, INT_MAX); // Unlimited
+
// Pre-parse into local storage, then delegate to device.
RecvTensorResponse proto;
- if (!proto.ParseFromZeroCopyStream(source->contents())) {
+ if (!proto.ParseFromCodedStream(&input) || !input.ConsumedEntireMessage()) {
return errors::InvalidArgument("Cannot parse tensor from response");
}
return device_->MakeTensorFromProto(proto.tensor(), alloc_attrs_, &tensor_);