We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e545aa commit 9c8f2bbCopy full SHA for 9c8f2bb
SplitTable.lua
@@ -31,11 +31,13 @@ end
31
function SplitTable:updateGradInput(input, gradOutput)
32
local dimension = self:_getPositiveDimension(input)
33
local slices = input:size(dimension)
34
- self.gradInput:resizeAs(input)
+ if self.gradInput then
35
+ self.gradInput:resizeAs(input)
36
- for i=1,slices do
37
- local currentGradInput = gradOutput[i];
38
- self.gradInput:select(dimension,i):copy(currentGradInput)
+ for i=1,slices do
+ local currentGradInput = gradOutput[i];
39
+ self.gradInput:select(dimension,i):copy(currentGradInput)
40
+ end
41
end
42
return self.gradInput
43
0 commit comments