flâneur — a map of the web's best reading

torch.index_select — PyTorch 2.12 documentation

docs.pytorch.org · 240 words · saved by 1 readers

The returned tensor has the same number of dimensions as the original tensor (input). The dimth dimension has the same size as the length of index; other dimensions have the same size as in the original tensor. Note The returned tensor does not use the same storage as the original tensor. If out has a different shape than expected, we silently change it to the correct shape, reallocating the underlying storage if necessary. input (Tensor) – the input tensor. dim (int) – the dimension in which we index index (IntTensor or LongTensor) – the 1-D tensor containing the indices to index out (Tensor, optional) – the output tensor. Example: Previous torch.index_reduce Next torch.masked_select Built with the PyData Sphinx Theme 0.15.4. previous torch.index_reduce next torch.masked_select Access comprehensive developer documentation for PyTorch Get in-depth tutorials for beginners and advanced developers Find development resources and get your questions answered Stay in touch for updates, event

torch.index_select # torch. index_select ( input , dim , index , * , out = None ) → Tensor # Returns a new tensor which indexes the input tensor along dimension dim using the entries in index . The returned tensor has the same number of dimensions as the original tensor ( input ). The dim th dimension has the same size as the length of index ; other dimensions have the same size as in the original tensor. Note The returned tensor does not use the same storage as the original tensor. If out has a different shape than expected, we silently change it to the correct shape, reallocating the

Explore this link on the map →

related reading