diff options
author | Justin Lebar <jlebar@google.com> | 2018-08-23 16:13:02 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-08-23 16:16:24 -0700 |
commit | e9b58d8f2ef1a4b828a7811ebd9931d483cdfe94 (patch) | |
tree | 77cf6f952cb827b15851763392db63504499c0ef /tensorflow/compiler/xla/service/hlo_parser.cc | |
parent | 3ed1f31b1a67b40fcc2450f89c7c4652dd837a5f (diff) |
[XLA] Switch from tensorflow::str_util::Join to absl::StrJoin.
PiperOrigin-RevId: 210018843
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_parser.cc')
-rw-r--r-- | tensorflow/compiler/xla/service/hlo_parser.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_parser.cc b/tensorflow/compiler/xla/service/hlo_parser.cc index b4425338ef..2cb2e407c5 100644 --- a/tensorflow/compiler/xla/service/hlo_parser.cc +++ b/tensorflow/compiler/xla/service/hlo_parser.cc @@ -18,6 +18,7 @@ limitations under the License. #include "absl/algorithm/container.h" #include "absl/memory/memory.h" #include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" #include "absl/strings/str_split.h" #include "tensorflow/compiler/xla/literal.h" #include "tensorflow/compiler/xla/literal_util.h" @@ -38,7 +39,7 @@ using ::absl::nullopt; using ::absl::optional; using ::absl::StrAppend; using ::absl::StrCat; -using ::tensorflow::str_util::Join; +using ::absl::StrJoin; using ::tensorflow::str_util::Split; using ::tensorflow::str_util::SplitAndParseAsInts; using ::tensorflow::strings::Printf; @@ -60,7 +61,7 @@ class HloParser { std::unique_ptr<HloModule> ConsumeHloModule() { return std::move(module_); } // Returns the error information. - string GetError() const { return Join(error_, "\n"); } + string GetError() const { return StrJoin(error_, "\n"); } // Stand alone parsing utils for various aggregate data types. StatusOr<HloSharding> ParseShardingOnly(); @@ -317,7 +318,7 @@ bool HloParser::Error(LocTy loc, absl::string_view msg) { error_lines.push_back(std::string(lexer_.GetLine(loc))); error_lines.push_back(col == 0 ? "" : StrCat(string(col - 1, ' '), "^")); - error_.push_back(Join(error_lines, "\n")); + error_.push_back(StrJoin(error_lines, "\n")); VLOG(1) << "Error: " << error_.back(); return false; } @@ -1806,10 +1807,10 @@ bool HloParser::ParseDenseLiteral(std::unique_ptr<Literal>* literal, std::vector<tensorflow::int64> elems_seen_until_dim( elems_seen_per_dim.begin(), elems_seen_per_dim.begin() + dim); return StrCat("[", - Join(elems_seen_until_dim, ",", - [](string* out, const tensorflow::int64& num_elems) { - StrAppend(out, num_elems - 1); - }), + StrJoin(elems_seen_until_dim, ",", + [](string* out, const tensorflow::int64& num_elems) { + StrAppend(out, num_elems - 1); + }), "]"); }; do { @@ -1996,7 +1997,7 @@ bool HloParser::ParseSparseLiteralHelper(std::unique_ptr<Literal>* literal, return Error( index_loc, StrCat("invalid multi-dimension index for shape with rank ", rank, - ": [", Join(index, ", "), "]")); + ": [", StrJoin(index, ", "), "]")); } } if (!ParseToken(TokKind::kColon, @@ -2173,10 +2174,10 @@ bool HloParser::ParseAttributeHelper( } else { allowed_attrs = StrCat( "Allowed attributes: ", - Join(attrs, ", ", - [&](string* out, const std::pair<string, AttrConfig>& kv) { - StrAppend(out, kv.first); - })); + StrJoin(attrs, ", ", + [&](string* out, const std::pair<string, AttrConfig>& kv) { + StrAppend(out, kv.first); + })); } return Error(loc, Printf("unexpected attribute \"%s\". %s", name.c_str(), allowed_attrs.c_str())); |