diff options
author | Soumith Chintala <soumith@gmail.com> | 2016-04-26 09:15:32 +0300 |
---|---|---|
committer | Soumith Chintala <soumith@gmail.com> | 2016-04-26 09:15:32 +0300 |
commit | 9c2079c7c9393a301f3a6286663dda9ef2f82b4e (patch) | |
tree | ea12afbc202906bd38d373fad1fe08c36dfbf0c4 | |
parent | d0c239bdcfcd01d0ce77127136d20fc93767c1bf (diff) | |
parent | 3bab6a6bf89c5dd494f12abeaaaf423755c0e2d5 (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.lua | 5 |
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 |