<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-depenent-content"data-active=""data-togglable=":kmath-tensors:dokkaHtmlPartial/commonMain"><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword"></span><spanclass="token keyword">fun </span><ahref="../index.html#-1680022905%2FClasslikes%2F-1345790395">Tensor</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="index.html">T</a><spanclass="token operator">></span><spanclass="token punctuation">.</span><ahref="transpose.html"><spanclass="token function">transpose</span></a><spanclass="token punctuation">(</span>i<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token operator"> = </span>-2<spanclass="token punctuation">, </span>j<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token operator"> = </span>-1<spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="../index.html#-1680022905%2FClasslikes%2F-1345790395">Tensor</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="index.html">T</a><spanclass="token operator">></span><spanclass="top-right-position"><spanclass="copy-icon"></span><divclass="copy-popup-wrapper popup-to-left"><spanclass="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><pclass="paragraph">Returns a tensor that is a transposed version of this tensor. The given dimensions <ahref="transpose.html">i</a> and <ahref="transpose.html">j</a> are swapped. For more information: https://pytorch.org/docs/stable/generated/torch.transpose.html</p><h4class="">Return</h4><pclass="paragraph">transposed tensor</p><h2class="">Parameters</h2><divdata-togglable="Parameters"><divclass="table"data-togglable="Parameters"><divclass="table-row"data-filterable-current=":kmath-tensors:dokkaHtmlPartial/commonMain"data-filterable-set=":kmath-tensors:dokkaHtmlPartial/commonMain"><divclass="main-subrow keyValue WithExtraAttributes"><divclass=""><spanclass="inline-flex"><div><span><span>i</span></span></div></span></div><div><divclass="title"><divdata-togglable="Parameters"><pclass="paragraph">the first dimension to be transposed</p></div></div></div></div></div><divclass="table-row"data-filterable-current=":kmath-tensors:dokkaHtmlPartial/commonMain"data-filterable-set=":kmath-tensors:dokkaHtmlPartial/commonMain"><divclass="main-subrow keyValue WithExtraAttributes"><divclass=""><spanclass="inline-flex"><div><span><span>j</span></span></div></span></div><div><divclass="title"><divdata-togglable="Parameters"><pclass="paragraph">the second dimension to be transposed</p></div></div></div></div></div></div></div></div></div>