Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SpatialAveragePooling.lua - github.com/torch/nn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 13b6b4529c89e59578f541fc1b989fda2a534d5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
local SpatialAveragePooling, parent = torch.class('nn.SpatialAveragePooling', 'nn.Module')

function SpatialAveragePooling:__init(kW, kH, dW, dH)
   parent.__init(self)

   self.kW = kW
   self.kH = kH
   self.dW = dW or 1
   self.dH = dH or 1
end

function SpatialAveragePooling:updateOutput(input)
   return input.nn.SpatialAveragePooling_updateOutput(self, input)
end

function SpatialAveragePooling:updateGradInput(input, gradOutput)
   if self.gradInput then
      return input.nn.SpatialAveragePooling_updateGradInput(self, input, gradOutput)
   end
end