Skip to content

Instantly share code, notes, and snippets.

View DmitryUlyanov's full-sized avatar

Dmitry Ulyanov DmitryUlyanov

View GitHub Profile
require 'nn'
require 'image'
require 'cutorch'
require 'cunn'
require 'cudnn'
-- adds first dummy dimension
function torch.Tensor:add_dummy()
local sz = self:size()
local new_sz = torch.Tensor(sz:size()+1)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.