ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Backend.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 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 __NNKIT_SUPPORT_TF_BACKEND_H__
18#define __NNKIT_SUPPORT_TF_BACKEND_H__
19
24
25#include <nnkit/Backend.h>
26
27#include <memory>
28#include <vector>
29
30namespace nnkit
31{
32namespace support
33{
34namespace tf
35{
36
38
39class Backend final : public nnkit::Backend
40{
41public:
42 Backend() = delete;
43 Backend(const Backend &) = delete;
44 Backend(Backend &&) = delete;
45
46 Backend(const char *pb_path, const char *info_path);
47
48 void prepare(const std::function<void(nnkit::TensorContext &)> &f) override;
49
50 void run(void) override;
51
52 void teardown(const std::function<void(nnkit::TensorContext &)> &f) override;
53
54private:
55 std::vector<std::unique_ptr<ParsedTensor>> _inputs;
56 std::vector<std::unique_ptr<ParsedTensor>> _outputs;
57
58 TensorDataMap _data_map;
59
60 Runner _tf_runner;
61};
62
63} // namespace tf
64} // namespace support
65} // namespace nnkit
66
67#endif // __NNKIT_SUPPORT_TF_BACKEND_H__
void teardown(const std::function< void(nnkit::TensorContext &)> &f) override
Definition Backend.cpp:105
Backend(Backend &&)=delete
void prepare(const std::function< void(nnkit::TensorContext &)> &f) override
Definition Backend.cpp:68
Backend(const Backend &)=delete
void run(void) override
Definition Backend.cpp:80
Class to map parsed tensor and memory for tensor values. For parsed tensor, this memory is used to fi...
Class to store tensor information parsed from test.info file under moco/test/tf.