From ad9e40e0ea6ca62baae082a7a1d3f44dcc2178a7 Mon Sep 17 00:00:00 2001 From: sseung Date: Thu, 1 Aug 2024 19:18:49 +0900 Subject: [PATCH] [onert] Introduce ExtraTensor 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..eefa56b0a14 --- /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 only by one opeartion layer. +// In other word, Extra tensor's scope is limited into a 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__