chromium/third_party/tflite/src/tensorflow/lite/kernels/cast.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 <algorithm>
#include <cmath>
#include <complex>
#include <cstddef>
#include <cstdint>
#include <limits>

#include "Eigen/Core"  // from @eigen_archive
#include "tensorflow/lite/core/c/common.h"
#include "tensorflow/lite/core/subgraph.h"
#include "tensorflow/lite/interpreter_options.h"
#include "tensorflow/lite/kernels/internal/tensor_ctypes.h"
#include "tensorflow/lite/kernels/kernel_util.h"
#include "tensorflow/lite/kernels/op_macros.h"

namespace tflite {
namespace ops {
namespace builtin {
namespace cast {

namespace {

constexpr int kInputTensor =;
constexpr int kOutputTensor =;

void copyCast(const float* in, int32_t* out, int num_elements) {}

void copyCast(const float* in, int16_t* out, int num_elements) {}

void copyCast(const float* in, uint8_t* out, int num_elements) {}

template <typename FromT, typename ToT>
void copyCast(const FromT* in, ToT* out, int num_elements) {}

template <typename ToT>
void copyCast(const std::complex<float>* in, ToT* out, int num_elements) {}

template <>
void copyCast(const std::complex<float>* in, std::complex<float>* out,
              int num_elements) {}

template <typename ToT>
void copyCast(const Eigen::half* in, ToT* out, int num_elements) {}

template <>
void copyCast(const Eigen::half* in, std::complex<float>* out,
              int num_elements) {}

template <typename FromT>
void copyCastToFloat16(const FromT* in, Eigen::half* out, int num_elements) {}

template <>
void copyCastToFloat16(const std::complex<float>* in, Eigen::half* out,
                       int num_elements) {}

template <>
void copyCastToFloat16(const Eigen::half* in, Eigen::half* out,
                       int num_elements) {}

TfLiteStatus castInt4ToFloat(TfLiteContext* context, const TfLiteTensor* in,
                             TfLiteTensor* out, int num_elements) {}

template <typename FromT>
TfLiteStatus copyToTensor(TfLiteContext* context, const FromT* in,
                          TfLiteTensor* out, int num_elements) {}

TfLiteStatus EvalImpl(TfLiteContext* context, const TfLiteTensor* input,
                      TfLiteTensor* output, const int num_elements) {}

struct OpData {};

void* Init(TfLiteContext* context, const char* /*buffer*/, size_t /*length*/) {}

void Free(TfLiteContext* context, void* op_data) {}

bool OutputCachingEnabled(const TfLiteContext* context) {}

bool ShouldCacheOutput(const TfLiteContext* context,
                       const TfLiteTensor* input) {}

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

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

}  // namespace
}  // namespace cast

TfLiteRegistration* Register_CAST() {}

}  // namespace builtin
}  // namespace ops
}  // namespace tflite