Skip to content

Commit

Permalink
Merge pull request #32 from DmitryUlyanov/patch-1
Browse files Browse the repository at this point in the history
Fix default parameter in GramMatrix module
  • Loading branch information
jcjohnson authored Oct 21, 2016
2 parents 616746b + f0b09dc commit d016c39
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fast_neural_style/GramMatrix.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ Output:

function Gram:__init(normalize)
parent.__init(self)
self.normalize = normalize or true
if normalize ~= nil then
assert(type(normalize) == 'boolean', 'normalize has to be true/false')
self.normalize = normalize
else
self.normalize = true
end
self.buffer = torch.Tensor()
end

Expand Down

0 comments on commit d016c39

Please sign in to comment.