Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed incorrect auto-type

  • Loading branch information...
commit 45e7d47a8b23c446395203c02711ca5149967ed2 1 parent 922fe63
Clement Farabet authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 init.lua
8 init.lua
View
@@ -665,10 +665,6 @@ function imgraph.colorize(...)
xlua.error('incorrect arguments', 'imgraph.colorize')
end
- -- auto type
- colormap = colormap or torch.Tensor():typeAs(grayscale)
- local colorized = torch.Tensor():typeAs(grayscale)
-
-- accept 3D grayscale
if grayscale:dim() == 3 and grayscale:size(1) == 1 then
grayscale = torch.Tensor(grayscale):resize(grayscale:size(2), grayscale:size(3))
@@ -679,6 +675,10 @@ function imgraph.colorize(...)
grayscale = torch.Tensor(grayscale:size(1), grayscale:size(2)):copy(grayscale)
end
+ -- auto type
+ colormap = colormap or torch.Tensor():typeAs(grayscale)
+ local colorized = torch.Tensor():typeAs(grayscale)
+
-- colorize !
grayscale.imgraph.colorize(colorized, grayscale, colormap)
Please sign in to comment.
Something went wrong with that request. Please try again.