aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/lua-torch/nn/Abs.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/Abs.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/Abs.lua')
-rw-r--r--contrib/lua-torch/nn/Abs.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/contrib/lua-torch/nn/Abs.lua b/contrib/lua-torch/nn/Abs.lua
new file mode 100644
index 000000000..b32b64f79
--- /dev/null
+++ b/contrib/lua-torch/nn/Abs.lua
@@ -0,0 +1,22 @@
+local Abs, parent = torch.class('nn.Abs', 'nn.Module')
+
+function Abs:__init()
+ parent.__init(self)
+end
+
+function Abs:updateOutput(input)
+ input.THNN.Abs_updateOutput(
+ input:cdata(),
+ self.output:cdata()
+ )
+ return self.output
+end
+
+function Abs:updateGradInput(input, gradOutput)
+ input.THNN.Abs_updateGradInput(
+ input:cdata(),
+ gradOutput:cdata(),
+ self.gradInput:cdata()
+ )
+ return self.gradInput
+end