summaryrefslogtreecommitdiffstats
path: root/contrib/torch/nn/lib/THNN/THNN.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/torch/nn/lib/THNN/THNN.h')
-rw-r--r--contrib/torch/nn/lib/THNN/THNN.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/contrib/torch/nn/lib/THNN/THNN.h b/contrib/torch/nn/lib/THNN/THNN.h
new file mode 100644
index 000000000..0019b7976
--- /dev/null
+++ b/contrib/torch/nn/lib/THNN/THNN.h
@@ -0,0 +1,33 @@
+#ifndef THNN_H
+#define THNN_H
+
+#include <stdbool.h>
+#include <TH.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif
+
+#define THNN_(NAME) TH_CONCAT_3(THNN_, Real, NAME)
+
+#define THIndexTensor THLongTensor
+#define THIndexTensor_(NAME) THLongTensor_ ## NAME
+
+#define THIntegerTensor THIntTensor
+#define THIntegerTensor_(NAME) THIntTensor_ ## NAME
+
+typedef long THIndex_t;
+typedef int THInteger_t;
+typedef void THNNState;
+
+#define THNN_resizeAs_indices(I1, I2) \
+ THLongStorage *size2 = THIndexTensor_(newSizeOf)(I2); \
+ if (!THTensor_(isSize)(I1, size2)) \
+ { \
+ THTensor_(resize)(I1, size2, NULL); \
+ } \
+ THLongStorage_free(size2);
+
+#include "generic/THNN.h"
+#include <THGenerateFloatTypes.h>
+
+#endif