tilus.Script.unsqueeze¶
- Script.unsqueeze(x, *, dim, out=None)[source]¶
Unsqueeze a dimension of a register tensor.
This instruction adds a new dimension of size 1 to the register tensor at the specified position. The dim parameter is the position where the new dimension will be added in the output tensor.
- Parameters:
x (RegisterTensor) – The register tensor to unsqueeze.
dim (int | Sequence[int]) – The dimension(s) to unsqueeze. If a single integer is provided, it specifies the position of the new
out (RegisterTensor, optional) – The register tensor to store the result. If not provided, a new register tensor will be allocated.
- Returns:
ret – The register tensor with the specified dimension(s) unsqueezed.
- Return type: