mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
30 lines
569 B
Lua
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])
|