blob: 2bc7a76638c9810d196508161efcd16cf5bb35db (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
local VolumetricMaxPooling, parent = torch.class('nn.VolumetricMaxPooling', 'nn.Module')
function VolumetricMaxPooling:__init(kT, kW, kH, dT, dW, dH)
parent.__init(self)
dT = dT or kT
dW = dW or kW
dH = dH or kH
self.kT = kT
self.kH = kH
self.kW = kW
self.dT = dT
self.dW = dW
self.dH = dH
self.indices = torch.Tensor()
end
function VolumetricMaxPooling:updateOutput(input)
input.nn.VolumetricMaxPooling_updateOutput(self, input)
return self.output
end
function VolumetricMaxPooling:updateGradInput(input, gradOutput)
input.nn.VolumetricMaxPooling_updateGradInput(self, input, gradOutput)
return self.gradInput
end
function VolumetricMaxPooling:empty()
self.gradInput:resize()
self.gradInput:storage():resize(0)
self.output:resize()
self.output:storage():resize(0)
self.indices:resize()
self.indices:storage():resize(0)
end
|