Skip to content

Commit

Permalink
fix for latest torch
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Leonard committed Aug 22, 2017
1 parent e10e11d commit 83a5f17
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 39 deletions.
36 changes: 0 additions & 36 deletions PrintSize.lua

This file was deleted.

2 changes: 1 addition & 1 deletion SequencerCriterion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function SequencerCriterion:updateGradInput(input, target)
end

if self.sizeAverage then
nn.utils.recursiveDiv(tableGradInput[i], seqlen)
nn.utils.recursiveDiv(tableGradInput, seqlen)
end

if torch.isTensor(input) then
Expand Down
5 changes: 3 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ function nn.require(packagename)
assert(torch.type(packagename) == 'string')
local success, message = pcall(function() require(packagename) end)
if not success then
print("missing package "..packagename..": run 'luarocks install nnx'")
print("missing package "..packagename..": run 'luarocks install '"..packagename.."'")
error(message)
end
end


-- c lib:
require "paths"
paths.require 'librnn'
pcall(function() paths.require 'librnn' end) -- Not sure why this works...
pcall(function() paths.require 'librnn' end)

unpack = unpack or table.unpack

Expand Down

0 comments on commit 83a5f17

Please sign in to comment.