Files
pytorch/random.lua
2012-01-25 14:55:20 +01:00

30 lines
569 B
Lua

local interface = wrap.CInterface.new()
interface:print(
[[
#include "luaT.h"
#include "TH.h"
]])
for _,name in ipairs({"seed", "initialSeed"}) do
interface:wrap(name,
string.format("THRandom_%s",name),
{{name="long", creturned=true}})
end
interface:wrap('manualSeed',
'THRandom_manualSeed',
{{name="long"}})
interface:register("random__")
interface:print(
[[
void torch_random_init(lua_State *L)
{
luaL_register(L, NULL, random__);
}
]])
interface:tofile(arg[1])