chromium/third_party/tflite_support/src/tensorflow_lite_support/cc/utils/common_utils.cc

/* Copyright 2020 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/utils/common_utils.h"

#include <fstream>

#include "absl/strings/str_split.h"  // from @com_google_absl

namespace tflite {
namespace support {
namespace utils {
namespace {
struct membuf : std::streambuf {};

void ReadIStreamLineByLine(
    std::istream* istream,
    const std::function<void(std::string)>& line_processor) {}

absl::node_hash_map<std::string, int> ReadIStreamLineSplits(
    std::istream* istream) {}

std::vector<std::string> ReadIStreamByLine(std::istream* istream) {}

}  // namespace

std::vector<std::string> LoadVocabFromFile(const std::string& path_to_vocab) {}

std::vector<std::string> LoadVocabFromBuffer(const char* vocab_buffer_data,
                                             const size_t vocab_buffer_size) {}

absl::node_hash_map<std::string, int> LoadVocabAndIndexFromFile(
    const std::string& path_to_vocab) {}

absl::node_hash_map<std::string, int> LoadVocabAndIndexFromBuffer(
    const char* vocab_buffer_data, const size_t vocab_buffer_size) {}

}  // namespace utils
}  // namespace support
}  // namespace tflite