From 545788604906cbfb61224e4379b9a949cdfba505 Mon Sep 17 00:00:00 2001 From: SeungHui Youn <61981457+zetwhite@users.noreply.github.com> Date: Fri, 2 Aug 2024 18:27:41 +0900 Subject: [PATCH] [onert] Introduce ExtraTensor (#13576) This PR introduces ExtraTensor. ExtraTensor means that the tensor is only used by one operation. ONE-DCO-1.0-Signed-off-by: seunghui youn --- .../core/include/backend/train/ExtraTensor.h | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 runtime/onert/core/include/backend/train/ExtraTensor.h diff --git a/runtime/onert/core/include/backend/train/ExtraTensor.h b/runtime/onert/core/include/backend/train/ExtraTensor.h new file mode 100644 index 00000000000..15253e6deb4 --- /dev/null +++ b/runtime/onert/core/include/backend/train/ExtraTensor.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2024 Samsung Electronics Co., Ltd. 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. + */ + +#ifndef __ONERT_BACKEND_EXTRA_H__ +#define __ONERT_BACKEND_EXTRA_H__ + +#include + +namespace onert +{ +namespace backend +{ +namespace train +{ + +// ExtraTensor is a tensor that is accessed within one operation layer. +// In other words, the scope of the extra tensor is confined to one specific layer. +class ExtraTensor final : public basic::Tensor +{ +public: + ExtraTensor() = delete; + +public: + ExtraTensor(const ir::OperandInfo &info) : basic::Tensor(info, nullptr) + { + // DO NOTHING + } +}; + +} // namespace train +} // namespace backend +} // namespace onert + +#endif // __ONERT_BACKEND_EXTRA_TENSOR_H__