diff options
author | Jonathan J Hunt <jjhunt@google.com> | 2015-01-08 17:51:37 +0300 |
---|---|---|
committer | Jonathan J Hunt <jjhunt@google.com> | 2015-01-08 20:08:21 +0300 |
commit | 608ac7c2bbf52677a38c6f2d7e45b8817e4ba3af (patch) | |
tree | 4cf6b285e8daa62bd1cb68ce684e0d5d4d6ec377 /test.lua | |
parent | 27acf6315e30181936a309e9831e18baec1a3f28 (diff) |
Added more informative pretty-printing.
Diffstat (limited to 'test.lua')
-rw-r--r-- | test.lua | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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) |