Commit bf258560 authored by Asim Shankar's avatar Asim Shankar Committed by Amit Patankar
Browse files

Avoid CHECKs in BundleReader, propagate errors instead.

Motivation:
We'd like to evolve the checkpoint format over time (e.g., enable
different types of compression). Without this change, a TensorFlow
version that encounters a format that it doesn't understand would CHECK fail
with an unhelpful error message.

With this, it propagates a clearer error message up, giving the user some
hints about what could be wrong.

I don't have a unittest for this - I thought about writing a bundle and
then strategically corrupting the bytes on disk before reading it back,
but that seems a bit much. The intention of this change is to enable
graceful reporting of forward compatibility breakages. Ideas for an
appropriate unittest are appreciated.

PiperOrigin-RevId: 157620358
parent 275e7d02
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment