forked from takezo5096/DNN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbatchdata.h
47 lines (38 loc) · 761 Bytes
/
batchdata.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
39
40
41
42
43
44
45
46
47
/*
* batchdata.h
*
* Created on: 2016/01/15
* Author: takeshi.fujita
*/
#ifndef BATCHDATA_H_
#define BATCHDATA_H_
class BatchData {
public:
float *X = NULL;
float *D = NULL;
int m, n, batchSize;
BatchData(int n, int m, int batchSize){
X = (float *) malloc(sizeof(*X) * n * batchSize);
D = (float *) malloc(sizeof(*D) * m * batchSize);
this->m = m;
this->n = n;
this->batchSize = batchSize;
}
~BatchData(){
if (X!=NULL){
free(X);
X = NULL;
}
if (D!=NULL){
free(D);
D = NULL;
}
}
float *getX(){
return X;
}
float *getD(){
return D;
}
};
#endif /* BATCHDATA_H_ */