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

github.com/torch/nngraph.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo Danihelka <danihelka@google.com>2015-03-27 20:31:36 +0300
committerIvo Danihelka <danihelka@google.com>2015-03-27 20:31:36 +0300
commit103c8946f5686871920f6f990ce6bba6baaa2a08 (patch)
tree002eb7650efae118fc7dd86e5a8ad1a2889db6a3
parent5eaa5f038180e389e337624db0834d43c5b11484 (diff)
Used no NaN flag for empty tensors.
-rw-r--r--node.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/node.lua b/node.lua
index c01bdae..62cefff 100644
--- a/node.lua
+++ b/node.lua
@@ -93,6 +93,9 @@ end
local function getNanFlag(data)
+ if data:nElement() == 0 then
+ return ''
+ end
local isNan = (data:ne(data):sum() > 0)
if isNan then
return 'NaN'