Internal change

PiperOrigin-RevId: 210145594
This commit is contained in:
Justin Lebar 2018-08-24 13:19:52 -07:00 committed by TensorFlower Gardener
parent a9e0c06a87
commit 94d267dfa6
4 changed files with 7 additions and 7 deletions

View File

@ -64,7 +64,7 @@ StatusOr<std::unique_ptr<Literal>> PackedLiteralReader::Read(
tensorflow::gtl::ArraySlice<float> field = result->data<float>();
char* data = tensorflow::bit_cast<char*>(field.data());
uint64 bytes = elements * sizeof(float);
tensorflow::StringPiece sp;
tensorflow::StringPiece sp; // non-absl OK
auto s = file_->Read(offset_, bytes, &sp, data);
offset_ += sp.size();
if (!s.ok()) {
@ -85,7 +85,7 @@ bool PackedLiteralReader::IsExhausted() const {
// Try to read a single byte from offset_. If we can't, we've
// exhausted the data.
char single_byte[1];
tensorflow::StringPiece sp;
tensorflow::StringPiece sp; // non-absl OK
auto s = file_->Read(offset_, sizeof(single_byte), &sp, single_byte);
return !s.ok();
}

View File

@ -409,9 +409,9 @@ TokKind HloLexer::LexString() {
string error;
// TODO(b/113077997): Change to absl::CUnescape once it works properly with
// copy-on-write std::string implementations.
if (!tensorflow::str_util::CUnescape(
tensorflow::StringPiece(raw.data(), raw.size()), &str_val_,
&error)) {
if (!tensorflow::str_util::CUnescape( // non-absl ok
tensorflow::StringPiece(raw.data(), raw.size()), // non-absl ok
&str_val_, &error)) {
LOG(ERROR) << "Failed unescaping string: " << raw << ". error: " << error;
return TokKind::kError;
}

View File

@ -36,7 +36,7 @@ using tensorflow::TensorShapeProto;
string GetOpDefName(const HloInstruction* instruction) {
string name = StrCat("hlo-", HloOpcodeString(instruction->opcode()));
tensorflow::str_util::TitlecaseString(&name, "-");
tensorflow::str_util::TitlecaseString(&name, "-"); // non-absl ok
name.erase(std::remove(name.begin(), name.end(), '-'), name.end());
if (instruction->opcode() == HloOpcode::kFusion) {

View File

@ -67,7 +67,7 @@ int main(int argc, char** argv) {
floats.push_back(value);
}
tensorflow::StringPiece content(
tensorflow::StringPiece content( // non-absl ok
tensorflow::bit_cast<const char*>(floats.data()),
floats.size() * sizeof(float));
TF_CHECK_OK(tensorflow::WriteStringToFile(tensorflow::Env::Default(),