diff options
author | soumith <soumith@gmail.com> | 2016-02-20 00:34:39 +0300 |
---|---|---|
committer | soumith <soumith@gmail.com> | 2016-02-20 00:34:58 +0300 |
commit | e3a55711ae0512777b50802cd279afb26154a466 (patch) | |
tree | 4ef4314510aa9216cf052865e1613767182a24fc /init.lua | |
parent | 14ef272fff8206546a948b7161fc143115564994 (diff) |
additional typecheck on mt
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -163,7 +163,8 @@ function torch.isTypeOf(obj, typeSpec) local mt = getmetatable(obj) while mt do - if mt.__typename and matchFunc(mt.__typename, typeSpec) then + if type(mt) == 'table' and mt.__typename + and matchFunc(mt.__typename, typeSpec) then return true end mt = getmetatable(mt) |