<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">infix </span><spanclass="token keyword">fun </span><ahref="../../../kmath-core/space.kscience.kmath.nd/-structure-n-d/index.html">StructureND</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="index.html">T</a><spanclass="token operator">></span><spanclass="token punctuation">.</span><ahref="dot.html"><spanclass="token function">dot</span></a><spanclass="token punctuation">(</span>other<spanclass="token operator">: </span><ahref="../../../kmath-core/space.kscience.kmath.nd/-structure-n-d/index.html">StructureND</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="index.html">T</a><spanclass="token operator">></span><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">Matrix product of two tensors.</p><pclass="paragraph">The behavior depends on the dimensionality of the tensors as follows:</p><ol><li><pclass="paragraph">If both tensors are 1-dimensional, the dot product (scalar) is returned.</p></li><li><pclass="paragraph">If both arguments are 2-dimensional, the matrix-matrix product is returned.</p></li><li><pclass="paragraph">If the first argument is 1-dimensional and the second argument is 2-dimensional, a 1 is prepended to its dimension for the purpose of the matrix multiply. After the matrix multiply, depending on the implementation the prepended dimension might be removed.</p></li><li><pclass="paragraph">If the first argument is 2-dimensional and the second argument is 1-dimensional, the matrix-vector product is returned.</p></li><li><pclass="paragraph">If both arguments are at least 1-dimensional and at least one argument is N-dimensional (where N 2), then a batched matrix multiply is returned. If the first argument is 1-dimensional, a 1 is prepended to its dimension for the purpose of the batched matrix multiply and removed after. If the second argument is 1-dimensional, a 1 is appended to its dimension for the purpose of the batched matrix multiple and removed after. The non-matrix (i.e., batch) dimensions are broadcast (and thus must be broadcastable). For example, if <codeclass="lang-kotlin">input</code> is a (j × 1 × n × n) tensor and <codeclass="lang-kotlin">other</code> is a (k × n × n) tensor, out will be a (j × k × n × n) tensor.</p></li></ol><pclass="paragraph">For more information: https://pytorch.org/docs/stable/generated/torch.matmul.html</p><h4class="">Return</h4><pclass="paragraph">a mathematical product of two tensors.</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>other</span></span></div></span></div><div><divclass="title"><divdata-togglable="Parameters"><pclass="paragraph">tensor to be multiplied.</p></div></div></div></div></div></div></div></div></div>