diff options
author | Soumith Chintala <soumith@gmail.com> | 2014-10-12 22:21:16 +0400 |
---|---|---|
committer | Soumith Chintala <soumith@gmail.com> | 2014-10-12 22:21:16 +0400 |
commit | 28f70cde89715250196c11e74369039dbed16877 (patch) | |
tree | 90364a32e2233b0b877d893ec78525b05257c703 | |
parent | 7594c740063c71b533cd2affd9b85213e2614e6d (diff) | |
parent | 74c9975dc1b2fc59e06a5ed86fca6e36dbbffd25 (diff) |
Merge pull request #6 from jonathantompson/newimage_fix
fixed qtwidget.newimage to actually accept tensors.
-rw-r--r-- | packages/qtwidget/init.lua | 2 |
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(...) |