【发布时间】:2018-12-30 22:24:19
【问题描述】:
这是我正在使用的代码:
local IcgResample, Parent = torch.class('icgnn.IcgResample', 'nn.Module')
function IcgResample:__init(inter_method, height_factor, width_factor, antialiasing)
Parent.__init(self)
if inter_method then
self.inter_method = inter_method
else
error('you have to specify an interpolation method')
end
self.height_factor = height_factor or 2
self.width_factor = width_factor or height_factor
if self.height_factor <= 0 or self.width_factor <= 0 then
error('factors have to be > 0')
end
if antialiasing then
self.antialiasing = true
else
self.antialiasing = false
end
end
function IcgResample:updateOutput(input)
input.icgnn.IcgResample_updateOutput(self, input)
return self.output
end
function IcgResample:updateGradInput(input, gradOutput)
input.icgnn.IcgResample_updateGradInput(self, input, gradOutput)
return self.gradInput
end
我遇到了标题的错误。我是lua的新手,我急于运行这段代码,有人知道如何解决这个问题吗? 我已经打印了输入,这是一个 cudaTensor。 icgnn 是一个模块。
【问题讨论】: