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

github.com/torch/qtlua.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Tompson <tompson@cims.nyu.edu>2014-10-12 22:14:18 +0400
committerJonathan Tompson <tompson@cims.nyu.edu>2014-10-12 22:14:18 +0400
commit74c9975dc1b2fc59e06a5ed86fca6e36dbbffd25 (patch)
tree90364a32e2233b0b877d893ec78525b05257c703
parent7594c740063c71b533cd2affd9b85213e2614e6d (diff)
fixed qtwidget.newimage to actually accept tensors.
-rw-r--r--packages/qtwidget/init.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/qtwidget/init.lua b/packages/qtwidget/init.lua
index 7b0bba5..dcfa7c6 100644
--- a/packages/qtwidget/init.lua
+++ b/packages/qtwidget/init.lua
@@ -255,7 +255,7 @@ function newimage(...)
setmetatable(self, imageClass)
local firstarg = ...
if (G.package.loaded['torch'] and G.package.loaded['libqttorch'] and
- G.torch.typename(firstarg) == "torch.Tensor") then
+ G.torch.type(firstarg):find('torch%..+Tensor')) then
self.port = qt.QtLuaPainter(qt.QImage.fromTensor(firstarg))
else
self.port = qt.QtLuaPainter(...)