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

github.com/torch/torch7.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Chanan <gchanan@fb.com>2017-08-09 22:22:52 +0300
committerSoumith Chintala <soumith@gmail.com>2017-08-15 09:50:55 +0300
commit56877b64af0bc805371eb06a0bb4505b351d16bb (patch)
tree83e490666ee78ac255716a7cd4eb5182f788d11a
parent723cc811227aca9b89ca6e74db8d0871bf030dd2 (diff)
Support __neg__, .neg(), and neg_() for Long, Int, Short tensor types.
-rw-r--r--lib/TH/generic/THTensorMath.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/TH/generic/THTensorMath.c b/lib/TH/generic/THTensorMath.c
index ac099cf..2ba394c 100644
--- a/lib/TH/generic/THTensorMath.c
+++ b/lib/TH/generic/THTensorMath.c
@@ -2845,10 +2845,12 @@ TENSOR_IMPLEMENT_LOGICAL(ne,!=)
#if defined(TH_REAL_IS_LONG)
LAB_IMPLEMENT_BASIC_FUNCTION(abs,labs)
+LAB_IMPLEMENT_BASIC_FUNCTION(neg,-)
#endif /* long only part */
#if defined(TH_REAL_IS_SHORT) || defined(TH_REAL_IS_INT)
LAB_IMPLEMENT_BASIC_FUNCTION(abs,abs)
+LAB_IMPLEMENT_BASIC_FUNCTION(neg,-)
#endif /* int only part */
#if defined(TH_REAL_IS_BYTE)