| 162 | Status status() const override { return status_; } |
| 163 | |
| 164 | int64 total_size() const override { |
| 165 | if (vocab_size_ == -1) { |
| 166 | int64 new_size = -1; |
| 167 | Status status = GetNumLinesInTextFile(env_, filename_, &new_size); |
| 168 | if (!status.ok()) { |
| 169 | LOG(WARNING) << "Unable to get line count: " << status; |
| 170 | new_size = -1; |
| 171 | } |
| 172 | *const_cast<int64*>(&vocab_size_) = new_size; |
| 173 | } |
| 174 | return vocab_size_; |
| 175 | } |
| 176 | |
| 177 | private: |
| 178 | Tensor key_; |
no test coverage detected