Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Commit

Permalink
Migrate from std::string to tensorflow::tstring.
Browse files Browse the repository at this point in the history
Note that during the transition period tstring is typedef'ed to std::string.

See: tensorflow/community#91
PiperOrigin-RevId: 282043204
  • Loading branch information
gharibian authored and copybara-github committed Nov 22, 2019
1 parent d979d9f commit 2594069
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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<string>()();
absl::string_view s = ctx->input(0).scalar<tstring>()();

// Construct encoded output tensors.
std::vector<int> encoded_ids;
Expand Down

0 comments on commit 2594069

Please sign in to comment.