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

github.com/torch/nngraph.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2016-04-26 09:15:32 +0300
committerSoumith Chintala <soumith@gmail.com>2016-04-26 09:15:32 +0300
commit9c2079c7c9393a301f3a6286663dda9ef2f82b4e (patch)
treeea12afbc202906bd38d373fad1fe08c36dfbf0c4
parentd0c239bdcfcd01d0ce77127136d20fc93767c1bf (diff)
parent3bab6a6bf89c5dd494f12abeaaaf423755c0e2d5 (diff)
Merge pull request #112 from rohanpadhye/module-type
Return type of gModule when no arguments are passed to method: type().
-rw-r--r--gmodule.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/gmodule.lua b/gmodule.lua
index 2a367d4..e5bd4d4 100644
--- a/gmodule.lua
+++ b/gmodule.lua
@@ -220,6 +220,10 @@ local function recursiveType(param, type_str)
end
function gModule:type(type, tensorCache)
+ if not type then
+ return self._type
+ end
+
tensorCache = tensorCache or {}
local function applyTypeToTable(table)
@@ -244,6 +248,7 @@ function gModule:type(type, tensorCache)
end
end
+ self._type = type
return self
end