From 9d16661af2116e22175b6403f088c7f2e86d4b0d Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Mon, 22 Aug 2016 10:02:12 -0800 Subject: Increase bytes limit in ParseFrom(). Change: 130957917 --- tensorflow/core/distributed_runtime/tensor_coding.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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_); -- cgit v1.2.3