tilus.Script.transpose¶
- Script.transpose(x, *, out=None)[source]¶
Transpose a 2-D register tensor.
This instruction transposes a 2-D register tensor, swapping its first and second dimensions. This instruction does not change the underlying data of the tensor, but only changes how the data is accessed. Thus, no communication is needed between threads in the thread block.
- Parameters:
x (RegisterTensor) – The register tensor to transpose. It must be a 2-D tensor.
out (RegisterTensor, optional) – The register tensor to store the result. If not provided, a new register tensor will be allocated.
- Returns:
ret – The transposed register tensor. The shape of the output tensor will be [x.shape[1], x.shape[0]].
- Return type: