diff options
author | Rohan Padhye <rohanpadhye@cs.berkeley.edu> | 2016-04-24 23:47:15 +0300 |
---|---|---|
committer | Rohan Padhye <rohanpadhye@cs.berkeley.edu> | 2016-04-24 23:47:15 +0300 |
commit | 3bab6a6bf89c5dd494f12abeaaaf423755c0e2d5 (patch) | |
tree | ea12afbc202906bd38d373fad1fe08c36dfbf0c4 | |
parent | d0c239bdcfcd01d0ce77127136d20fc93767c1bf (diff) |
Returning the module's type to conform to torch/nn#691
-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 |