From dc3099c444d294b39cd79fe1d1a4bff59a0c6180 Mon Sep 17 00:00:00 2001
From: Mangpo Phothilimthana <mangpo@google.com>
Date: Tue, 28 Jul 2020 11:47:43 -0700
Subject: [PATCH] Remove read limit of ReadBinaryProto.

PiperOrigin-RevId: 323619709
Change-Id: I2b21c8c83d62f5f21c892ddad93c9d5a162fe6cf
---
 tensorflow/core/platform/env.cc | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/tensorflow/core/platform/env.cc b/tensorflow/core/platform/env.cc
index 05d95ba0425..4cc36e0b705 100644
--- a/tensorflow/core/platform/env.cc
+++ b/tensorflow/core/platform/env.cc
@@ -544,15 +544,7 @@ Status ReadBinaryProto(Env* env, const string& fname,
   std::unique_ptr<RandomAccessFile> file;
   TF_RETURN_IF_ERROR(env->NewRandomAccessFile(fname, &file));
   std::unique_ptr<FileStream> stream(new FileStream(file.get()));
-
-  // TODO(jiayq): the following coded stream is for debugging purposes to allow
-  // one to parse arbitrarily large messages for MessageLite. One most likely
-  // doesn't want to put protobufs larger than 64MB on Android, so we should
-  // eventually remove this and quit loud when a large protobuf is passed in.
   protobuf::io::CodedInputStream coded_stream(stream.get());
-  // Total bytes hard limit / warning limit are set to 1GB and 512MB
-  // respectively.
-  coded_stream.SetTotalBytesLimit(1024LL << 20, 512LL << 20);
 
   if (!proto->ParseFromCodedStream(&coded_stream) ||
       !coded_stream.ConsumedEntireMessage()) {