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

github.com/torch/image.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2016-05-04 16:58:18 +0300
committerSoumith Chintala <soumith@gmail.com>2016-05-04 16:58:18 +0300
commitcde140760fa8b9f03fe3360b3f1a8648cfb9e89b (patch)
tree893ddbafb1b74e6735e7e6ff73bed40f5b0c9293
parente1bbfffdcfd0a85dce2753346b084727c59f6029 (diff)
parent416abb90c4035f983e747044cf0a1983ea30099c (diff)
Merge pull request #166 from tkoeppe/gauss
Fix double-to-byte conversion order
-rw-r--r--test/test.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test.lua b/test/test.lua
index c0c3bf3..8040673 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -16,10 +16,10 @@ end
local function toByteTensor(x)
- local y = torch.round(x):byte()
+ local y = torch.round(x)
y[torch.le(x, 0)] = 0
y[torch.ge(x, 255)] = 255
- return y
+ return y:byte()
end