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:
authorThomas Köppe <tkoeppe@google.com>2016-05-04 15:40:50 +0300
committerThomas Köppe <tkoeppe@google.com>2016-05-04 16:23:28 +0300
commit416abb90c4035f983e747044cf0a1983ea30099c (patch)
tree893ddbafb1b74e6735e7e6ff73bed40f5b0c9293
parent2aab35acef8bd773b083c14ac080ef07ae6433cf (diff)
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