chromium/third_party/tflite/src/tensorflow/lite/kernels/pad.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/kernels/internal/reference/pad.h"

#include <stdint.h>

#include <limits>
#include <type_traits>

#include "tensorflow/lite/core/c/common.h"
#include "tensorflow/lite/kernels/internal/compatibility.h"
#include "tensorflow/lite/kernels/internal/optimized/optimized_ops.h"
#include "tensorflow/lite/kernels/internal/reference/reference_ops.h"
#include "tensorflow/lite/kernels/internal/tensor.h"
#include "tensorflow/lite/kernels/internal/tensor_ctypes.h"
#include "tensorflow/lite/kernels/internal/types.h"
#include "tensorflow/lite/kernels/kernel_util.h"

namespace tflite {
namespace ops {
namespace builtin {
namespace pad {

// This file has two implementations of Pad.
enum KernelType {};

struct PadContext {};

bool CheckPaddingOverflow(PadContext* op_context) {}

// Helper template function for resizing output array based on the input size
// and padding size. Do not call this directly, call ResizeOutputTensor()
// instead.
template <typename PaddingIntegerType>
TfLiteStatus ResizeOutputTensor(TfLiteContext* context,
                                PadContext* op_context) {}

// Resizes output array based on the input size and padding size. This function
// is callable from both Prepare() and Eval() as long as the caller ensures the
// paddings data is present.
TfLiteStatus ResizeOutputTensor(TfLiteContext* context,
                                PadContext* op_context) {}

// Helper template function for getting pad params. Do not call this directly,
// call GetPadParams() instead.
template <typename PaddingIntegerType>
tflite::PadParams GetPadParams(TfLiteContext* context,
                               const PadContext& op_context) {}

tflite::PadParams GetPadParams(TfLiteContext* context,
                               const PadContext& op_context) {}

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

template <typename integer_type>
TfLiteStatus EvalInt(TfLiteContext* context, const PadContext& op_context,
                     const tflite::PadParams& op_params) {}

template <KernelType kernel_type>
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {}

}  // namespace pad

TfLiteRegistration* Register_PAD_REF() {}

TfLiteRegistration* Register_PAD_GENERIC_OPT() {}

TfLiteRegistration* Register_PAD() {}

// Also register Pad as PadV2.
TfLiteRegistration* Register_PADV2_REF() {}

TfLiteRegistration* Register_PADV2_GENERIC_OPT() {}

TfLiteRegistration* Register_PADV2() {}

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