Change:
<!-- A clear and concise description of what content in is an issue. If this has to do with the general website, please file an issue at instead. If this has to do with , please file an issue at --In the getting started section section the following quote appears: I guess this is from previous versions where CUDA support was not built-in and this can be removed, correct? cc
This seems to be easy fixable docs issue
If gets merged this is fixed.
Thanks for the PR Just merged it.

Discussion:
assert_strict_equal(zc, z) <del> def index_variable(num_indices, max_indices): index = torch.randperm(max_indices)[:num_indices].long() </del> <ins> def index_variable(shape, max_indices): if not isinstance(shape, tuple): shape = (shape,) index = torch.rand(*shape).mul_(max_indices).floor_().long() return Variable(index, requires_grad=False) def gather_variable(shape, index_dim, max_indices): assert len(shape) == 2 assert index_dim < 2 batch_dim = 1 - index_dim index = torch.LongTensor(*shape) for i in range(shape[index_dim]): index.select(index_dim, i).copy_( torch.randperm(max_indices)[:shape[batch_dim]]) </ins> return Variable(index, requires_grad=False)

(IndexCopy,     (0,),               ((S, S), index_variable(2, S), (2, S))      ), (IndexFill,     (0, 2),             ((S, S), index_variable(2, S))              ), (IndexSelect,   (0,),               ((S, S), index_variable(2, S))              ), <ins> (Gather,        (0,),               ((M, S), gather_variable((S, S), 1, M))     ), (Gather,        (1,),               ((M, S), gather_variable((M, S//2), 0, S)), 'dim1'), (Scatter,       (0,),               ((M, S), gather_variable((S, S), 1, M), (S, S))), (Scatter,       (1,),               ((M, S), gather_variable((M, S//2), 0, S), (M, S//2)), 'dim1'), </ins> (Concat,        (0,),               ((1, S, S), (2, S, S), (3, S, S))           ), (Resize,        (S*S, S),           ((S, S, S),)                                ), (Diag,          (),                 ((S, S),),                  '2d'            ),

return grad_input <del> # TODO: gather </del> <ins> class Gather(Function): def __init__(self, dim): super(Gather, self).__init__() self.dim = dim def forward(self, input, index): assert not self.needs_input_grad[1], "Gather can't differentiate "  "the index" self.input_size = input.size() self.save_for_backward(index) return input.gather(self.dim, index) def backward(self, grad_output): index, = self.saved_tensors grad_input = grad_output.new(self.input_size).zero_() return grad_input.scatter_(self.dim, index, grad_output), None class Scatter(InplaceFunction): def __init__(self, dim, inplace=False): super(Scatter, self).__init__(inplace) self.dim = dim def forward(self, input, index, source): assert not self.needs_input_grad[1], "Scatter can't differentiate "  "the index" if self.inplace: self.mark_dirty(input) else: input = input.clone() self.save_for_backward(index) return input.scatter_(self.dim, index, source) def backward(self, grad_output): index, = self.saved_tensors grad_input = grad_source = None if self.needs_input_grad[0]: grad_input = grad_output.clone() grad_input.scatter_(self.dim, index, 0) if self.needs_input_grad[2]: grad_source = grad_output.gather(self.dim, index) return grad_input, None, grad_source </ins> # TODO: kthvalue # TODO: repeat # TODO: sort

def index_select(self, dim, index): return IndexSelect(dim)(self, index) <ins> def gather(self, dim, index): return Gather(dim)(self, index) def scatter(self, dim, index, source): return Scatter(dim)(self, index, source) def scatter_(self, dim, index, source): return Scatter(dim, True)(self, index, source) </ins> def masked_copy(self, mask, variable): return MaskedCopy()(self, mask, variable)