注册 登录
编程论坛 Lua论坛

求助lua代码转化为python语言

poplar17 发布于 2020-01-07 21:55, 2795 次点击
程序代码:

local function foc(n)
   -- separating occipital lobe and frontal lobe
   local SEPARATION = 163
   local ft = {}
   local c = 1
   for j = 1, n do
      for i = 1, CH do
     if i < SEPARATION then
        ft[c] = {}
        ft[c][1] = i
        ft[c][2] = j
     else
        ft[c] = {}
        ft[c][1] = i
        ft[c][2] = n + j
     end
     c = c + 1
      end
   end
   return torch.Tensor(ft)
end
0 回复
1