TensorBolt
ndarray_std.h
1 /****************************************************************************
2  * Copyright (C) 2019 by Soulaymen Chouri *
3  * *
4  * This file is part of TensorBolt. *
5  * *
6  * What follows is the Modified BSD License. *
7  * See also http://www.opensource.org/licenses/BSD-3-Clause *
8  * Copyright (c) 2019, Soulaymen Chouri. All rights reserved. *
9  * Redistribution and use in source and binary forms, with or without *
10  * modification, are permitted provided that the following conditions *
11  * are met: *
12  * *
13  * 1. Redistributions of source code must retain the above copyright *
14  * notice, this list of conditions and the following disclaimer. *
15  * *
16  * 2. Redistributions in binary form must reproduce the above *
17  * copyright notice, this list of conditions and the following *
18  * disclaimer in the documentation and/or other materials provided *
19  * with the distribution. *
20  * *
21  * 3. Neither the name of the author nor the names of other *
22  * contributors may be used to endorse or promote products derived *
23  * from this software without specific prior written permission. *
24  * *
25  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR *
26  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
27  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
28  * DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, *
29  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
30  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR *
31  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *
32  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, *
33  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING *
34  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
35  * POSSIBILITY OF SUCH DAMAGE. *
36  ****************************************************************************/
37 
45 #ifndef _TB_NDARRAY_STD_BACKEND_H_
46 #define _TB_NDARRAY_STD_BACKEND_H_
47 
48 #include <stdint.h>
49 #include <stdarg.h>
50 
55 typedef struct NDShape {
56  uint64_t rank;
57  uint64_t* dims;
58  uint64_t raw_len;
59  uint64_t* strides;
60 }NDShape;
61 
65 typedef struct NDShapeStack {
67  uint64_t i;
69 
73 typedef struct NDArray {
74  tb_float* data;
76 }NDArray;
77 
78 #endif
uint64_t i
Definition: ndarray_std.h:67
Tensor Shape DO NOT MANUALLY MODIFY ANY DATA ON THIS STRUCTURE. I will find you.
Definition: ndarray_std.h:55
uint64_t rank
Definition: ndarray_std.h:56
Tensor data structure.
Definition: ndarray_std.h:73
NDShape * shape
Definition: ndarray_std.h:75
Treats NDShape as a stack to pop elements, does not modify the original shape.
Definition: ndarray_std.h:65
uint64_t raw_len
Definition: ndarray_std.h:58
uint64_t * strides
Definition: ndarray_std.h:59
NDShape * shape
Definition: ndarray_std.h:66
tb_float * data
Definition: ndarray_std.h:74
uint64_t * dims
Definition: ndarray_std.h:57