chromium/third_party/tflite/src/tensorflow/lite/util.cc

/* Copyright 2017 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/util.h"

#include <algorithm>
#include <complex>
#include <cstddef>
#include <cstring>
#include <initializer_list>
#include <memory>
#include <string>
#include <vector>

#include "tensorflow/lite/array.h"
#include "tensorflow/lite/builtin_ops.h"
#include "tensorflow/lite/core/c/common.h"
#include "tensorflow/lite/core/macros.h"
#include "tensorflow/lite/schema/schema_generated.h"

namespace tflite {
namespace {

TfLiteStatus UnresolvedOpInvoke(TfLiteContext* context, TfLiteNode* node) {}

}  // namespace

bool IsFlexOp(const char* custom_name) {}

TfLiteIntArray* ConvertVectorToTfLiteIntArray(const std::vector<int>& input) {}

TfLiteIntArray* ConvertArrayToTfLiteIntArray(const int ndims, const int* dims) {}

bool EqualArrayAndTfLiteIntArray(const TfLiteIntArray* a, const int b_size,
                                 const int* b) {}

size_t CombineHashes(std::initializer_list<size_t> hashes) {}

TfLiteStatus GetSizeOfType(TfLiteContext* context, const TfLiteType type,
                           size_t* bytes) {}

TfLiteRegistration CreateUnresolvedCustomOp(const char* custom_op_name) {}

bool IsUnresolvedCustomOp(const TfLiteRegistration& registration) {}

std::string GetOpNameByRegistration(const TfLiteRegistration& registration) {}

bool IsValidationSubgraph(const char* name) {}

TfLiteStatus MultiplyAndCheckOverflow(size_t a, size_t b, size_t* product) {}

TfLiteStatus BytesRequired(TfLiteType type, const int* dims, size_t dims_size,
                           size_t* bytes, TfLiteContext* context_) {}

TensorUniquePtr BuildTfLiteTensor() {}

TensorUniquePtr BuildTfLiteTensor(TfLiteType type, const std::vector<int>& dims,
                                  TfLiteAllocationType allocation_type) {}

// Allocates an appropriate sized buffer underneath returned tensor
// based on the value of `dims`. Since arena allocated tensors should not
// be managed by the user, we do not permit `kTfLiteArena` as a
// valid allocation type.
TensorUniquePtr BuildTfLiteTensor(TfLiteType type, IntArrayUniquePtr dims,
                                  TfLiteAllocationType allocation_type) {}

}  // namespace tflite