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 Chintala <soumith@gmail.com>2016-10-13 16:20:02 +0300
committerGitHub <noreply@github.com>2016-10-13 16:20:02 +0300
commit9bf79e05f51b2eb9374101fe3bb1610925586193 (patch)
tree084bfae2e2765df0afd145106797acdfed881c6d
parent4a7b30fe61bfb71bba196b92df6da3cd4f4b917c (diff)
parente131ae6186d97f02029dd2f6d91f07806a93800a (diff)
Merge pull request #796 from howard0su/master
Fix error when run torch.test multi times
-rw-r--r--test/test.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua
index 547a9f8..4290036 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -2946,11 +2946,13 @@ function torchtest.classInModule()
mytester:assert(x ~= nil, 'Could not create class in module')
-- Remove the global
_G['_mymodule123'] = nil
+ debug.getregistry()['_mymodule123.myclass']=nil
end
function torchtest.classNoModule()
local x = torch.class('_myclass123')
mytester:assert(x ~= nil, 'Could not create class in module')
+ debug.getregistry()['_myclass123'] = nil
end
function torchtest.type()
@@ -2977,6 +2979,9 @@ function torchtest.isTypeOfInheritance()
mytester:assert(torch.isTypeOf(b, A), 'isTypeOf error: inheritance')
mytester:assert(not torch.isTypeOf(c, 'B'), 'isTypeOf error: common parent')
mytester:assert(not torch.isTypeOf(c, B), 'isTypeOf error: common parent')
+ debug.getregistry()['A'] = nil
+ debug.getregistry()['B'] = nil
+ debug.getregistry()['C'] = nil
end
function torchtest.isTypeOfPartial()
@@ -3020,6 +3025,13 @@ function torchtest.isTypeOfPartial()
'isTypeOf error: inheritance')
mytester:assert(not torch.isTypeOf(ttm, 'TorchMember'),
'isTypeOf error: inheritance')
+ debug.getregistry()['TorchDummy'] = nil
+ debug.getregistry()['OtherTorchDummy'] = nil
+ debug.getregistry()['TorchMember'] = nil
+ debug.getregistry()['OtherTorchMember'] = nil
+ debug.getregistry()['FirstTorchMember'] = nil
+ debug.getregistry()['SecondTorchMember'] = nil
+ debug.getregistry()['ThirdTorchMember'] = nil
end
function torchtest.isTypeOfPattern()