forked from torch/torch7
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.c
93 lines (74 loc) · 2.76 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
91
92
93
#include "general.h"
#include "utils.h"
extern void torch_utils_init(lua_State *L);
extern void torch_random_init(lua_State *L);
extern void torch_File_init(lua_State *L);
extern void torch_DiskFile_init(lua_State *L);
extern void torch_MemoryFile_init(lua_State *L);
extern void torch_PipeFile_init(lua_State *L);
extern void torch_Timer_init(lua_State *L);
extern void torch_ByteStorage_init(lua_State *L);
extern void torch_CharStorage_init(lua_State *L);
extern void torch_ShortStorage_init(lua_State *L);
extern void torch_IntStorage_init(lua_State *L);
extern void torch_LongStorage_init(lua_State *L);
extern void torch_FloatStorage_init(lua_State *L);
extern void torch_DoubleStorage_init(lua_State *L);
extern void torch_HalfStorage_init(lua_State *L);
extern void torch_ByteTensor_init(lua_State *L);
extern void torch_CharTensor_init(lua_State *L);
extern void torch_ShortTensor_init(lua_State *L);
extern void torch_IntTensor_init(lua_State *L);
extern void torch_LongTensor_init(lua_State *L);
extern void torch_FloatTensor_init(lua_State *L);
extern void torch_DoubleTensor_init(lua_State *L);
extern void torch_HalfTensor_init(lua_State *L);
extern void torch_ByteTensorOperator_init(lua_State *L);
extern void torch_CharTensorOperator_init(lua_State *L);
extern void torch_ShortTensorOperator_init(lua_State *L);
extern void torch_IntTensorOperator_init(lua_State *L);
extern void torch_LongTensorOperator_init(lua_State *L);
extern void torch_FloatTensorOperator_init(lua_State *L);
extern void torch_DoubleTensorOperator_init(lua_State *L);
extern void torch_TensorMath_init(lua_State *L);
LUA_EXTERNC DLL_EXPORT int luaopen_libtorch(lua_State *L);
int luaopen_libtorch(lua_State *L)
{
lua_newtable(L);
lua_pushvalue(L, -1);
lua_setglobal(L, "torch");
torch_utils_init(L);
torch_File_init(L);
torch_ByteStorage_init(L);
torch_CharStorage_init(L);
torch_ShortStorage_init(L);
torch_IntStorage_init(L);
torch_LongStorage_init(L);
torch_FloatStorage_init(L);
torch_DoubleStorage_init(L);
torch_HalfStorage_init(L);
torch_ByteTensor_init(L);
torch_CharTensor_init(L);
torch_ShortTensor_init(L);
torch_IntTensor_init(L);
torch_LongTensor_init(L);
torch_FloatTensor_init(L);
torch_DoubleTensor_init(L);
torch_HalfTensor_init(L);
torch_ByteTensorOperator_init(L);
torch_CharTensorOperator_init(L);
torch_ShortTensorOperator_init(L);
torch_IntTensorOperator_init(L);
torch_LongTensorOperator_init(L);
torch_FloatTensorOperator_init(L);
torch_DoubleTensorOperator_init(L);
torch_Timer_init(L);
torch_DiskFile_init(L);
torch_PipeFile_init(L);
torch_MemoryFile_init(L);
torch_TensorMath_init(L);
torch_random_init(L);
// Create 'torch.Allocator' type.
luaT_newmetatable(L, "torch.Allocator", NULL, NULL, NULL, NULL);
return 1;
}