Skip to content

Commit 9d16661

Browse files
Increase bytes limit in ParseFrom().
Change: 130957917
1 parent 2275ace commit 9d16661

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tensorflow/core/distributed_runtime/tensor_coding.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,12 @@ void TensorResponse::InitPartial(const RecvTensorResponse& response) {
7575

7676
Status TensorResponse::ParseFrom(Source* source) {
7777
if (!on_host_) {
78+
protobuf::io::CodedInputStream input(source->contents());
79+
input.SetTotalBytesLimit(INT_MAX, INT_MAX); // Unlimited
80+
7881
// Pre-parse into local storage, then delegate to device.
7982
RecvTensorResponse proto;
80-
if (!proto.ParseFromZeroCopyStream(source->contents())) {
83+
if (!proto.ParseFromCodedStream(&input) || !input.ConsumedEntireMessage()) {
8184
return errors::InvalidArgument("Cannot parse tensor from response");
8285
}
8386
return device_->MakeTensorFromProto(proto.tensor(), alloc_attrs_, &tensor_);

0 commit comments

Comments
 (0)