如何为 Torch REPL 指定启动文件
How to specify startup file for Torch REPL
我想在每次启动 Torch REPL 时定义一些命令行便利函数 运行。例如,
function cl()
os.execute('clear')
end
和那种性质的东西。每次启动 REPL 时如何将这样的函数添加到命名空间?
我在网上搜索了 "luajit|torch|trepl startup|rc file" 但找不到任何相关线索。
你可以给你的 repl 添加别名以使用默认的 -l 参数:
alias thnew='th -lmyadditions '
其中 myadditions.lua 是您要执行的文件,它位于您的 lua 路径中。
我想在每次启动 Torch REPL 时定义一些命令行便利函数 运行。例如,
function cl()
os.execute('clear')
end
和那种性质的东西。每次启动 REPL 时如何将这样的函数添加到命名空间?
我在网上搜索了 "luajit|torch|trepl startup|rc file" 但找不到任何相关线索。
你可以给你的 repl 添加别名以使用默认的 -l 参数:
alias thnew='th -lmyadditions '
其中 myadditions.lua 是您要执行的文件,它位于您的 lua 路径中。