forked from majianjia/nnom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnnom_tensor.h
38 lines (30 loc) · 1.14 KB
/
nnom_tensor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* Copyright (c) 2018-2019
* Jianjia Ma, Wearable Bio-Robotics Group (WBR)
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-02-05 Jianjia Ma The first version
* 2019-02-10 Jianjia Ma Compiler supports dense net connection
*/
#ifndef __NNOM_TENSOR_H__
#define __NNOM_TENSOR_H__
#include "nnom.h"
nnom_tensor_t* new_tensor(nnom_tensor_t* t, uint32_t num_dim);
nnom_tensor_t* tensor_set_attribuites(nnom_tensor_t* t, nnom_qformat_t qfmt, uint32_t num_dim, nnom_shape_data_t* dim);
nnom_tensor_t* tensor_cpy_attributes(nnom_tensor_t* des, nnom_tensor_t* src);
size_t tensor_size(nnom_tensor_t* t);
// only support 3d tensor
// change format from CHW to HWC
// the shape of the data, input data, output data
void tensor_hwc2chw_q7(nnom_tensor_t* des, nnom_tensor_t* src);
// change format from CHW to HWC
// the shape of the data, input data, output data
void tensor_chw2hwc_q7(nnom_tensor_t* des, nnom_tensor_t* src);
// deprecated.
void hwc2chw_q7(nnom_shape_t shape, q7_t* p_in, q7_t* p_out);
void chw2hwc_q7(nnom_shape_t shape, q7_t* p_in, q7_t* p_out);
#endif