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

github.com/torch/torch7.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsoumith <soumith@gmail.com>2016-02-20 00:34:39 +0300
committersoumith <soumith@gmail.com>2016-02-20 00:34:58 +0300
commite3a55711ae0512777b50802cd279afb26154a466 (patch)
tree4ef4314510aa9216cf052865e1613767182a24fc /init.lua
parent14ef272fff8206546a948b7161fc143115564994 (diff)
additional typecheck on mt
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index f928cb5..978a4af 100644
--- a/init.lua
+++ b/init.lua
@@ -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)