新手求教,有关函数调用的问题
lua吧
全部回复
仅看楼主
level 1
365634450 楼主
请问调用函数中的nn.Identity后面为什么会有两个括号?
nn.Identity的定义如下:
2015年10月08日 13点10分 1
level 1
365634450 楼主
2015年10月09日 01点10分 3
level 1
365634450 楼主
2015年10月09日 01点10分 4
level 1
365634450 楼主
th>module = nn.Identity()
th>getmetatable(module)
nn.Module
2015年10月10日 02点10分 9
level 1
365634450 楼主
local Module = torch.class('nn.Module')
function Module:__call__(input, gradOutput)
self:forward(input)
if gradOutput then
self:backward(input, gradOutput)
return self.output, self.gradInput
else return self.output
end
end
2015年10月10日 02点10分 10
1