If you are using pytorch version before 0.4.0, you would have to use Variable from torch.autograd.
For example in his case, maps must have been a tensor. So to transform to a Variable,
from torch.autograd import Variable
maps = Variable(maps)
But I am not sure why this is done though.