tensor.unsqueeze
Insert single-dimensional entries to the shape of an input tensor (data). Takes one required input axes - which contains a list of dimension indices and this operator will insert a dimension of value 1 into the corresponding index of the output tensor (expanded).
Args
self
(@Tensor<T>
) - Tensor of data to unsquezee.axes
(Span<usize>
) - List of integers indicating the dimensions to be inserted.
Panics
Panics if the given axes have duplicate elements.
Panics if one of the given axes is invalid.
Returns
Reshaped Tensor<T>
with same data as input.
Example
Last updated