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:
authorAndreas Fidjeland <andreas.fidjeland@gmail.com>2012-09-13 19:49:02 +0400
committerAndreas Fidjeland <andreas.fidjeland@gmail.com>2012-09-13 19:49:35 +0400
commit49c57008c04228a6598f867a5a88c5ffc99e61be (patch)
treeb9f46e92c82eac71a8afa95ffe4ec98f379fb8c2
parent66421de171a303366dd6e87bc9b6acfd99d03dcd (diff)
Fixed hessian parameter flattening
This previously failed for nn modules which do not return any hessian parameters.
-rw-r--r--hessian.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/hessian.lua b/hessian.lua
index 4ecc90a..af604d5 100644
--- a/hessian.lua
+++ b/hessian.lua
@@ -336,7 +336,7 @@ function nn.hessian.enable()
local flatParameters = flatten(parameters)
local flatGradParameters = flatten(gradParameters)
local flatHessianParameters
- if hessianParameters[1] then
+ if hessianParameters and hessianParameters[1] then
flatHessianParameters = flatten(hessianParameters)
end