Skip to content

Commit d5f7f6a

Browse files
authored
[Runtime] Remove read limit of ReadBinaryProto. (#981)
Signed-off-by: Secret.Sun <[email protected]>
1 parent cf16856 commit d5f7f6a

File tree

1 file changed

+0
-7
lines changed
  • tensorflow/core/platform

1 file changed

+0
-7
lines changed

tensorflow/core/platform/env.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -508,14 +508,7 @@ Status ReadBinaryProto(Env* env, const string& fname,
508508
TF_RETURN_IF_ERROR(env->NewRandomAccessFile(fname, &file));
509509
std::unique_ptr<FileStream> stream(new FileStream(file.get()));
510510

511-
// TODO(jiayq): the following coded stream is for debugging purposes to allow
512-
// one to parse arbitrarily large messages for MessageLite. One most likely
513-
// doesn't want to put protobufs larger than 64MB on Android, so we should
514-
// eventually remove this and quit loud when a large protobuf is passed in.
515511
::tensorflow::protobuf::io::CodedInputStream coded_stream(stream.get());
516-
// Total bytes hard limit / warning limit are set to 1GB and 512MB
517-
// respectively.
518-
coded_stream.SetTotalBytesLimit(1024LL << 20, 512LL << 20);
519512

520513
if (!proto->ParseFromCodedStream(&coded_stream) ||
521514
!coded_stream.ConsumedEntireMessage()) {

0 commit comments

Comments
 (0)