Rate this Page

Function torch ::stable::transpose#

Function Documentation#

inline torch::stable::Tensor torch::stable::transpose(const torch::stable::Tensor &self, int64_t dim0, int64_t dim1)#

Stable version of the transpose.int op.

Returns a tensor that is a transposed version of the input, with dimensions dim0 and dim1 swapped. The returned tensor shares storage with the input.

Minimum compatible version: PyTorch 2.9.

Parameters:
  • self – The input tensor.

  • dim0 – The first dimension to transpose.

  • dim1 – The second dimension to transpose.

Returns:

A transposed view of the input tensor.