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

github.com/torch/nn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan J Hunt <jjhunt@google.com>2015-01-08 17:51:37 +0300
committerJonathan J Hunt <jjhunt@google.com>2015-01-08 20:08:21 +0300
commit608ac7c2bbf52677a38c6f2d7e45b8817e4ba3af (patch)
tree4cf6b285e8daa62bd1cb68ce684e0d5d4d6ec377 /test.lua
parent27acf6315e30181936a309e9831e18baec1a3f28 (diff)
Added more informative pretty-printing.
Diffstat (limited to 'test.lua')
-rw-r--r--test.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/test.lua b/test.lua
index 27c3dde..65ff3b1 100644
--- a/test.lua
+++ b/test.lua
@@ -22,6 +22,22 @@ local function equal(t1, t2, msg)
end
+--[[ Generate tests to exercise the tostring component of modules. ]]
+local tostringTestModules = {
+ nnLinear = nn.Linear(1, 2),
+ nnReshape = nn.Reshape(10),
+ nnSpatialZeroPadding = nn.SpatialZeroPadding(1, 1, 1, 1)}
+for test_name, component in pairs(tostringTestModules) do
+ nntest['tostring' .. test_name] =
+ function ()
+ mytester:assert(tostring(component):find(torch.type(component) .. '(',
+ 1, true),
+ 'nn components should have a descriptive tostring' ..
+ ' beginning with the classname')
+ end
+end
+
+
function nntest.Add()
local inj_vals = {math.random(3,5), 1} -- Also test the inj = 1 spatial case
local ini = math.random(3,5)