aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/lua-torch/nn/LogSoftMax.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-05-23 18:14:15 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-05-23 18:14:15 +0100
commit714eb56e1760fdfb26afccde92664d3a2f1e8435 (patch)
tree84d1399acbb92f852b4bd64f9ea5412680b0c6ab /contrib/lua-torch/nn/LogSoftMax.lua
parent220a51ff68013dd668a45b78c60a7b8bfc10f074 (diff)
downloadrspamd-714eb56e1760fdfb26afccde92664d3a2f1e8435.tar.gz
rspamd-714eb56e1760fdfb26afccde92664d3a2f1e8435.zip
[Minor] Move lua contrib libraries to lua- prefix
Diffstat (limited to 'contrib/lua-torch/nn/LogSoftMax.lua')
-rw-r--r--contrib/lua-torch/nn/LogSoftMax.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/lua-torch/nn/LogSoftMax.lua b/contrib/lua-torch/nn/LogSoftMax.lua
new file mode 100644
index 000000000..37c8acae4
--- /dev/null
+++ b/contrib/lua-torch/nn/LogSoftMax.lua
@@ -0,0 +1,19 @@
+local LogSoftMax = torch.class('nn.LogSoftMax', 'nn.Module')
+
+function LogSoftMax:updateOutput(input)
+ input.THNN.LogSoftMax_updateOutput(
+ input:cdata(),
+ self.output:cdata()
+ )
+ return self.output
+end
+
+function LogSoftMax:updateGradInput(input, gradOutput)
+ input.THNN.LogSoftMax_updateGradInput(
+ input:cdata(),
+ gradOutput:cdata(),
+ self.gradInput:cdata(),
+ self.output:cdata()
+ )
+ return self.gradInput
+end