forked from clementfarabet/lua---nnx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.c
90 lines (70 loc) · 2.48 KB
/
init.c
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#include "TH.h"
#include "luaT.h"
#include "omp.h"
#define torch_(NAME) TH_CONCAT_3(torch_, Real, NAME)
#define torch_string_(NAME) TH_CONCAT_STRING_3(torch., Real, NAME)
#define nn_(NAME) TH_CONCAT_3(nn_, Real, NAME)
static const void* torch_FloatTensor_id = NULL;
static const void* torch_DoubleTensor_id = NULL;
#include "generic/Abs.c"
#include "THGenerateFloatTypes.h"
#include "generic/HardShrink.c"
#include "THGenerateFloatTypes.h"
#include "generic/SpatialLinear.c"
#include "THGenerateFloatTypes.h"
#include "generic/SpatialUpSampling.c"
#include "THGenerateFloatTypes.h"
#include "generic/SpatialReSampling.c"
#include "THGenerateFloatTypes.h"
#include "generic/SpatialMaxSampling.c"
#include "THGenerateFloatTypes.h"
#include "generic/SparseCriterion.c"
#include "THGenerateFloatTypes.h"
#include "generic/DistMarginCriterion.c"
#include "THGenerateFloatTypes.h"
#include "generic/SpatialSparseCriterion.c"
#include "THGenerateFloatTypes.h"
#include "generic/SpatialMSECriterion.c"
#include "THGenerateFloatTypes.h"
#include "generic/SpatialClassNLLCriterion.c"
#include "THGenerateFloatTypes.h"
#include "generic/Threshold.c"
#include "THGenerateFloatTypes.h"
#include "generic/SpatialGraph.c"
#include "THGenerateFloatTypes.h"
#include "generic/DataSetLabelMe.c"
#include "THGenerateFloatTypes.h"
DLL_EXPORT int luaopen_libnnx(lua_State *L)
{
torch_FloatTensor_id = luaT_checktypename2id(L, "torch.FloatTensor");
torch_DoubleTensor_id = luaT_checktypename2id(L, "torch.DoubleTensor");
nn_FloatSpatialLinear_init(L);
nn_FloatHardShrink_init(L);
nn_FloatAbs_init(L);
nn_FloatThreshold_init(L);
nn_FloatSpatialUpSampling_init(L);
nn_FloatSpatialReSampling_init(L);
nn_FloatSpatialMaxSampling_init(L);
nn_FloatDistMarginCriterion_init(L);
nn_FloatSparseCriterion_init(L);
nn_FloatSpatialSparseCriterion_init(L);
nn_FloatSpatialMSECriterion_init(L);
nn_FloatSpatialClassNLLCriterion_init(L);
nn_FloatSpatialGraph_init(L);
nn_FloatDataSetLabelMe_init(L);
nn_DoubleSpatialLinear_init(L);
nn_DoubleHardShrink_init(L);
nn_DoubleAbs_init(L);
nn_DoubleThreshold_init(L);
nn_DoubleSpatialUpSampling_init(L);
nn_DoubleSpatialReSampling_init(L);
nn_DoubleSpatialMaxSampling_init(L);
nn_DoubleDistMarginCriterion_init(L);
nn_DoubleSparseCriterion_init(L);
nn_DoubleSpatialSparseCriterion_init(L);
nn_DoubleSpatialMSECriterion_init(L);
nn_DoubleSpatialClassNLLCriterion_init(L);
nn_DoubleSpatialGraph_init(L);
nn_DoubleDataSetLabelMe_init(L);
return 1;
}