torch.unsqueeze
- torch.unsqueeze(input, dim) → Tensor
Returns a new tensor with a dimension of size one inserted at the specified position.
The returned tensor shares the same underlying data with this tensor.
A
dimvalue within the range[-input.dim() -can be used. Negative will correspond to applied at = .