aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/lua-torch/nn/Sigmoid.lua
blob: 0126f6f8f89e1d04550ccd60787d2bdca8e1f7e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
local Sigmoid = torch.class('nn.Sigmoid', 'nn.Module')

function Sigmoid:updateOutput(input)
   input.THNN.Sigmoid_updateOutput(
      input:cdata(),
      self.output:cdata()
   )
   return self.output
end

function Sigmoid:updateGradInput(input, gradOutput)
   input.THNN.Sigmoid_updateGradInput(
      input:cdata(),
      gradOutput:cdata(),
      self.gradInput:cdata(),
      self.output:cdata()
   )
   return self.gradInput
end