torch.stack — PyTorch 2.13 documentation
dim (int, optional) – dimension to insert. Has to be between 0 and the number of dimensions of concatenated tensors (inclusive). Default: 0 out (Tensor, optional) – the output tensor. Example: Previous torch.squeeze_copy Next torch.swapaxes Built with the PyData Sphinx Theme 0.15.4. previous torch.squeeze_copy next torch.swapaxes 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 info, and the latest news By submitting this form, I consent to receive marketing emails from the LF and its projects regarding their events, training, research, developments, and related announcements. I understand that I can unsubscribe at any time using the links in the footers of the emails I receive. Privacy Policy By submitting this form, I consent to receive marketing emails from the LF and its projects regarding their events, training, research,
Rate this Page ★ ★ ★ ★ ★ torch.stack(tensors, dim=0, *, out=None) → Tensor# Concatenates a sequence of tensors along a new dimension. All tensors need to be of the same size. See also torch.cat() concatenates the given sequence along an existing dimension. Parameters: tensors (sequence of Tensors) – sequence of tensors to concatenate dim (int, optional) – dimension to insert. Has to be between 0 and the number of dimensions of concatenated tensors (inclusive). Default: 0 Keyword Arguments: out (Tensor, optional) – the output tensor. Example: >>> x = torch.randn(2, 3) >>> x…
saved by
related reading
- torch.stack — PyTorch 2.12 documentationdocs.pytorch.org
- torch.Tensor — PyTorch 2.12 documentationdocs.pytorch.org
- PyTorch internals : ezyang's blogblog.ezyang.com
- torch.Tensor.expanddocs.pytorch.org
- torch.reshape — PyTorch 2.12 documentationdocs.pytorch.org
- torch.index_select — PyTorch 2.12 documentationdocs.pytorch.org
- torch.unravel_indexdocs.pytorch.org
- GitHub - srush/Tensor-Puzzles: Solve puzzles. Improve your pytorch.github.com
- Tensors — PyTorch Tutorials 2.12.0+cu130 documentationpytorch.org
- Tensors — PyTorch Tutorials 2.13.0+cu130 documentationdocs.pytorch.org
- Chapter 0: Fundamentals - ARENAlearn.arena.education
- torch.zeros_like — PyTorch 2.12 documentationdocs.pytorch.org