Internal change
PiperOrigin-RevId: 210145594
This commit is contained in:
parent
a9e0c06a87
commit
94d267dfa6
@ -64,7 +64,7 @@ StatusOr<std::unique_ptr<Literal>> PackedLiteralReader::Read(
|
|||||||
tensorflow::gtl::ArraySlice<float> field = result->data<float>();
|
tensorflow::gtl::ArraySlice<float> field = result->data<float>();
|
||||||
char* data = tensorflow::bit_cast<char*>(field.data());
|
char* data = tensorflow::bit_cast<char*>(field.data());
|
||||||
uint64 bytes = elements * sizeof(float);
|
uint64 bytes = elements * sizeof(float);
|
||||||
tensorflow::StringPiece sp;
|
tensorflow::StringPiece sp; // non-absl OK
|
||||||
auto s = file_->Read(offset_, bytes, &sp, data);
|
auto s = file_->Read(offset_, bytes, &sp, data);
|
||||||
offset_ += sp.size();
|
offset_ += sp.size();
|
||||||
if (!s.ok()) {
|
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
|
// Try to read a single byte from offset_. If we can't, we've
|
||||||
// exhausted the data.
|
// exhausted the data.
|
||||||
char single_byte[1];
|
char single_byte[1];
|
||||||
tensorflow::StringPiece sp;
|
tensorflow::StringPiece sp; // non-absl OK
|
||||||
auto s = file_->Read(offset_, sizeof(single_byte), &sp, single_byte);
|
auto s = file_->Read(offset_, sizeof(single_byte), &sp, single_byte);
|
||||||
return !s.ok();
|
return !s.ok();
|
||||||
}
|
}
|
||||||
|
@ -409,9 +409,9 @@ TokKind HloLexer::LexString() {
|
|||||||
string error;
|
string error;
|
||||||
// TODO(b/113077997): Change to absl::CUnescape once it works properly with
|
// TODO(b/113077997): Change to absl::CUnescape once it works properly with
|
||||||
// copy-on-write std::string implementations.
|
// copy-on-write std::string implementations.
|
||||||
if (!tensorflow::str_util::CUnescape(
|
if (!tensorflow::str_util::CUnescape( // non-absl ok
|
||||||
tensorflow::StringPiece(raw.data(), raw.size()), &str_val_,
|
tensorflow::StringPiece(raw.data(), raw.size()), // non-absl ok
|
||||||
&error)) {
|
&str_val_, &error)) {
|
||||||
LOG(ERROR) << "Failed unescaping string: " << raw << ". error: " << error;
|
LOG(ERROR) << "Failed unescaping string: " << raw << ". error: " << error;
|
||||||
return TokKind::kError;
|
return TokKind::kError;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ using tensorflow::TensorShapeProto;
|
|||||||
|
|
||||||
string GetOpDefName(const HloInstruction* instruction) {
|
string GetOpDefName(const HloInstruction* instruction) {
|
||||||
string name = StrCat("hlo-", HloOpcodeString(instruction->opcode()));
|
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());
|
name.erase(std::remove(name.begin(), name.end(), '-'), name.end());
|
||||||
|
|
||||||
if (instruction->opcode() == HloOpcode::kFusion) {
|
if (instruction->opcode() == HloOpcode::kFusion) {
|
||||||
|
@ -67,7 +67,7 @@ int main(int argc, char** argv) {
|
|||||||
floats.push_back(value);
|
floats.push_back(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
tensorflow::StringPiece content(
|
tensorflow::StringPiece content( // non-absl ok
|
||||||
tensorflow::bit_cast<const char*>(floats.data()),
|
tensorflow::bit_cast<const char*>(floats.data()),
|
||||||
floats.size() * sizeof(float));
|
floats.size() * sizeof(float));
|
||||||
TF_CHECK_OK(tensorflow::WriteStringToFile(tensorflow::Env::Default(),
|
TF_CHECK_OK(tensorflow::WriteStringToFile(tensorflow::Env::Default(),
|
||||||
|
Loading…
Reference in New Issue
Block a user