chromium/third_party/tflite_support/src/tensorflow_lite_support/cc/task/processor/bert_preprocessor.cc

/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow_lite_support/cc/task/processor/bert_preprocessor.h"

#include "absl/status/status.h"  // from @com_google_absl
#include "absl/strings/ascii.h"  // from @com_google_absl
#include "tensorflow_lite_support/cc/common.h"
#include "tensorflow_lite_support/cc/port/status_macros.h"
#include "tensorflow_lite_support/cc/task/core/task_utils.h"
#include "tensorflow_lite_support/cc/text/tokenizers/tokenizer_utils.h"
#include "tensorflow_lite_support/cc/utils/common_utils.h"

namespace tflite {
namespace task {
namespace processor {

CreateStatusWithPayload;
StatusOr;
TfLiteSupportStatus;
CreateTokenizerFromProcessUnit;
TokenizerResult;
PopulateTensor;

constexpr int kTokenizerProcessUnitIndex =;
constexpr int kIdsTensorIndex =;
constexpr int kSegmentIdsTensorIndex =;
constexpr int kMaskTensorIndex =;
constexpr char kClassificationToken[] =;
constexpr char kSeparator[] =;

/* static */
StatusOr<std::unique_ptr<BertPreprocessor>> BertPreprocessor::Create(
    tflite::task::core::TfLiteEngine* engine,
    const std::initializer_list<int> input_tensor_indices) {}

// TODO(b/241507692) Add a unit test for a model with dynamic tensors.
absl::Status BertPreprocessor::Init() {}

absl::Status BertPreprocessor::Preprocess(const std::string& input_text) {}

}  // namespace processor
}  // namespace task
}  // namespace tflite