ONE - On-device Neural Engine
Loading...
Searching...
No Matches
OperationUtils.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef __ONERT_BACKEND_TRAIN_OPS_OPERATION_UTILS_H__
18#define __ONERT_BACKEND_TRAIN_OPS_OPERATION_UTILS_H__
19
20#include <ops/OperationUtils.h>
21#include <cker/train/Types.h>
22#include <ir/train/LossInfo.h>
23
24namespace onert
25{
26namespace backend
27{
28namespace train
29{
30namespace ops
31{
32
39
47
69 const IPortableTensor *output,
70 const IPortableTensor *input_backprop,
71 IPortableTensor *output_backprop);
72
80void biasGrad(const IPortableTensor *input_backprop, IPortableTensor *bias_grad);
81
89
90} // namespace ops
91} // namespace train
92} // namespace backend
93} // namespace onert
94
95#endif // __ONERT_BACKEND_TRAIN_OPS_OPERATION_UTILS_H__
A tensor class that is portable for other backends.
const T * getBuffer(const IPortableTensor *tensor)
uint32_t getNumberOfElements(const IPortableTensor *tensor)
nnfw::cker::PaddingType getPaddingType(ir::PaddingType ir_padding_type)
uint32_t getSizeOfDimension(const IPortableTensor *tensor, uint32_t dimensionIdx)
uint32_t getNumberOfDimensions(const IPortableTensor *tensor)
void biasGrad(const IPortableTensor *input_backprop, IPortableTensor *bias_grad)
backpropagate bias
const IPortableTensor * backpropActivation(const ir::Activation &activation, const IPortableTensor *output, const IPortableTensor *input_backprop, IPortableTensor *output_backprop)
backpropagate acitvation
nnfw::cker::Shape getShape(const IPortableTensor *tensor)
Get shape of tensor.
nnfw::cker::train::LossReductionType convertLossReductionType(ir::train::LossReductionType type)
convert loss reduction type