From 259406973a597a7630784320509559fb60595184 Mon Sep 17 00:00:00 2001 From: Dero Gharibian Date: Fri, 22 Nov 2019 14:30:57 -0800 Subject: [PATCH] Migrate from std::string to tensorflow::tstring. Note that during the transition period tstring is typedef'ed to std::string. See: https://github.com/tensorflow/community/pull/91 PiperOrigin-RevId: 282043204 --- tensor2tensor/data_generators/ops/subword_text_encoder_ops.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tensor2tensor/data_generators/ops/subword_text_encoder_ops.cc b/tensor2tensor/data_generators/ops/subword_text_encoder_ops.cc index d0ba6ec8f..9e8959f96 100644 --- a/tensor2tensor/data_generators/ops/subword_text_encoder_ops.cc +++ b/tensor2tensor/data_generators/ops/subword_text_encoder_ops.cc @@ -14,6 +14,7 @@ using ::tensorflow::OpKernelContext; using ::tensorflow::Status; using ::tensorflow::Tensor; using ::tensorflow::TensorShape; +using ::tensorflow::tstring; using ::tensorflow::shape_inference::InferenceContext; REGISTER_OP("SubwordTextEncoderEncode") @@ -36,7 +37,7 @@ class SubwordTextEncoderEncodeOp : public OpKernel { void Compute(OpKernelContext* ctx) override { // Get input string and deserialize into ArticleExample proto. - const string& s = ctx->input(0).scalar()(); + absl::string_view s = ctx->input(0).scalar()(); // Construct encoded output tensors. std::vector encoded_ids;