| 41 | namespace xla { |
| 42 | |
| 43 | StatusOr<Literal> TextLiteralReader::ReadPath(absl::string_view path) { |
| 44 | CHECK(!absl::EndsWith(path, ".gz")) |
| 45 | << "TextLiteralReader no longer supports reading .gz files"; |
| 46 | std::unique_ptr<tensorflow::RandomAccessFile> file; |
| 47 | Status s = |
| 48 | tensorflow::Env::Default()->NewRandomAccessFile(std::string(path), &file); |
| 49 | if (!s.ok()) { |
| 50 | return s; |
| 51 | } |
| 52 | |
| 53 | TextLiteralReader reader(file.release()); |
| 54 | return reader.ReadAllLines(); |
| 55 | } |
| 56 | |
| 57 | TextLiteralReader::TextLiteralReader(tensorflow::RandomAccessFile* file) |
| 58 | : file_(file) {} |
nothing calls this directly
no test coverage detected