<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-content"data-active=""data-togglable=":kmath-tensors:dokkaHtmlPartial/commonMain"><divclass="symbol monospace"><spanclass="token keyword">interface </span><ahref="index.html">TensorAlgebra</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="index.html">T</a><spanclass="token punctuation">, </span><spanclass="token keyword"></span><ahref="index.html">A</a><spanclass="token operator"> : </span><ahref="../../../kmath-core/space.kscience.kmath.operations/-ring/index.html">Ring</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="index.html">T</a><spanclass="token operator">></span><spanclass="token operator">></span> : <ahref="../../../kmath-core/space.kscience.kmath.nd/-ring-ops-n-d/index.html">RingOpsND</a><spanclass="token operator"><</span><spanclass="token keyword"></span><ahref="index.html">T</a><spanclass="token punctuation">, </span><spanclass="token keyword"></span><ahref="index.html">A</a><spanclass="token operator">></span><spanclass="clearfix"><spanclass="floating-right">(<ahref="https://github.com/SciProgCentre/kmath/tree/master/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/TensorAlgebra.kt#L19">source</a>)</span></span></div><pclass="paragraph">Algebra over a ring on <ahref="../index.html#-1680022905%2FClasslikes%2F-1345790395">Tensor</a>. For more information: https://proofwiki.org/wiki/Definition:Algebra_over_Ring</p><h4class="">Parameters</h4><divclass="table"><divclass="table-row"data-filterable-current=":kmath-tensors:dokkaHtmlPartial/commonMain"data-filterable-set=":kmath-tensors:dokkaHtmlPartial/commonMain"><divclass="main-subrow keyValue "><divclass=""><spanclass="inline-flex"><div><u><span><span>T</span></span></u></div></span></div><div><divclass="title"><pclass="paragraph">the type of items in the tensors.</p></div></div></div></div></div><h4class="">Inheritors</h4><divclass="table"><divclass="table-row"data-filterable-current=":kmath-tensors:dokkaHtmlPartial/commonMain"data-filterable-set=":kmath-tensors:dokkaHtmlPartial/commonMain"><divclass="main-subrow keyValue "><divclass=""><spanclass="inline-flex"><div><ahref="../-tensor-partial-division-algebra/index.html">TensorPartialDivisionAlgebra</a></div></span></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 "><divclass=""><spanclass="inline-flex"><div><ahref="../../space.kscience.kmath.tensors.core/-int-tensor-algebra/index.html">IntTensorAlgebra</a></div></span></div><div></div></div></div></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-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="../../../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="arg-max.html"><spanclass="token function">argMax</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">dim<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token punctuation">, </span></span><spanclass="parameter ">keepDim<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a></span></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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token operator">></span></div><divclass="brief "><pclass="paragraph">Returns the index of maximum value of each row of the input tensor in the given dimension <ahref="arg-max.html">dim</a>.</p></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-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="../../../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="arg-min.html"><spanclass="token function">argMin</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">dim<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token punctuation">, </span></span><spanclass="parameter ">keepDim<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a></span></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="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token operator">></span></div><divclass="brief "><pclass="paragraph">Returns the index of minimum value of each row of the input tensor in the given dimension <ahref="arg-min.html">dim</a>.</p></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-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="diagonal-embedding.html"><spanclass="token function">diagonalEmbedding</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">diagonalEntries<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></span><spanclass="parameter ">offset<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token operator"> = </span><spanclass="token constant">0</span><spanclass="token punctuation">, </span></span><spanclass="parameter ">dim1<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></span><spanclass="parameter ">dim2<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token operator"> = </span>-1</span></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></div><divclass="brief "><pclass="paragraph">Creates a tensor whose diagonals of certain 2D planes (specified by <ahref="diagonal-embedding.html">dim1</a> and <ahref="diagonal-embedding.html">dim2</a>) are filled by <ahref="diagonal-embedding.html">diagonalEntries</a>. To facilitate creating batched diagonal matrices, the 2D planes formed by the last two dimensions of the returned tensor are chosen by default.</p></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-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="../../../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="max.html"><spanclass="token function">max</span></a><spanclass="token punctuation">(</span><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="index.html">T</a><spanclass="token operator">?</span></div><divclass="brief "><pclass="paragraph">Returns the maximum value of all elements in the input tensor or null if there are no values</p></div><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword"></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="max.html"><spanclass="token function">max</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">dim<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token punctuation">, </span></span><spanclass="parameter ">keepDim<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a></span></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></div><divclass="brief "><pclass="paragraph">Returns the maximum value of each row of the input tensor in the given dimension <ahref="max.html">dim</a>.</p></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-content"data-active=""data-togglable=":kmath-tensors:dokkaHtmlPartial/commonMain"><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword">operator override </span><spanclass="token keyword">fun </span><ahref="index.html">T</a><spanclass="token punctuation">.</span><ahref="minus.html"><spanclass="token function">minus</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">arg<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></span></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></div><divclass="brief "><pclass="paragraph">Each element of the tensor <ahref="minus.html">arg</a> is subtracted from this value. The resulting tensor is returned.</p></div><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword">operator override </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="minus.html"><spanclass="token function">minus</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">arg<spanclass="token operator">: </span><ahref="index.html">T</a></span></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></div><divclass="brief "><pclass="paragraph">Subtracts the scalar <ahref="minus.html">arg</a> from each element of this tensor and returns a new resulting tensor.</p></div><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword">operator override </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="minus.html"><spanclass="token function">minus</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">arg<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></span></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></div><divclass="brief "><pclass="paragraph">Each element of the tensor <ahref="minus.html">arg</a> is subtracted from each element of this tensor. The resulting tensor is returned.</p></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-content"data-active=""data-togglable=":kmath-tensors:dokkaHtmlPartial/commonMain"><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword">operator </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="minus-assign.html"><spanclass="token function">minusAssign</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">value<spanclass="token operator">: </span><ahref="index.html">T</a></span></span><spanclass="token punctuation">)</span></div><divclass="brief "><pclass="paragraph">Subtracts the scalar <ahref="minus-assign.html">value</a> from each element of this tensor.</p></div><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword">operator </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="minus-assign.html"><spanclass="token function">minusAssign</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">arg<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></span></span><spanclass="token punctuation">)</span></div><divclass="brief "><pclass="paragraph">Each element of the tensor <ahref="minus-assign.html">arg</a> is subtracted from each element of this tensor.</p></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-content"data-active=""data-togglable=":kmath-tensors:dokkaHtmlPartial/commonMain"><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword">operator override </span><spanclass="token keyword">fun </span><ahref="index.html">T</a><spanclass="token punctuation">.</span><ahref="plus.html"><spanclass="token function">plus</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">arg<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></span></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></div><divclass="brief "><pclass="paragraph">Each element of the tensor <ahref="plus.html">arg</a> is added to this value. The resulting tensor is returned.</p></div><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword">operator override </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="plus.html"><spanclass="token function">plus</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">arg<spanclass="token operator">: </span><ahref="index.html">T</a></span></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></div><divclass="brief "><pclass="paragraph">Adds the scalar <ahref="plus.html">arg</a> to each element of this tensor and returns a new resulting tensor.</p></div><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword">operator override </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="plus.html"><spanclass="token function">plus</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">arg<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></span></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></div><divclass="brief "><pclass="paragraph">Each element of the tensor <ahref="plus.html">arg</a> is added to each element of this tensor. The resulting tensor is returned.</p></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-content"data-active=""data-togglable=":kmath-tensors:dokkaHtmlPartial/commonMain"><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword">operator </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="plus-assign.html"><spanclass="token function">plusAssign</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">value<spanclass="token operator">: </span><ahref="index.html">T</a></span></span><spanclass="token punctuation">)</span></div><divclass="brief "><pclass="paragraph">Adds the scalar <ahref="plus-assign.html">value</a> to each element of this tensor.</p></div><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword">operator </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="plus-assign.html"><spanclass="token function">plusAssign</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">arg<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></span></span><spanclass="token punctuation">)</span></div><divclass="brief "><pclass="paragraph">Each element of the tensor <ahref="plus-assign.html">arg</a> is added to each element of this tensor.</p></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-content"data-active=""data-togglable=":kmath-tensors:dokkaHtmlPartial/commonMain"><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword">operator override </span><spanclass="token keyword">fun </span><ahref="index.html">T</a><spanclass="token punctuation">.</span><ahref="times.html"><spanclass="token function">times</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">arg<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></span></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></div><divclass="brief "><pclass="paragraph">Each element of the tensor <ahref="times.html">arg</a> is multiplied by this value. The resulting tensor is returned.</p></div><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword">operator override </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="times.html"><spanclass="token function">times</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">arg<spanclass="token operator">: </span><ahref="index.html">T</a></span></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></div><divclass="brief "><pclass="paragraph">Multiplies the scalar <ahref="times.html">arg</a> by each element of this tensor and returns a new resulting tensor.</p></div><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword">operator override </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="times.html"><spanclass="token function">times</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">arg<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></span></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></div><divclass="brief "><pclass="paragraph">Each element of the tensor <ahref="times.html">arg</a> is multiplied by each element of this tensor. The resulting tensor is returned.</p></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-content"data-active=""data-togglable=":kmath-tensors:dokkaHtmlPartial/commonMain"><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword">operator </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="times-assign.html"><spanclass="token function">timesAssign</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">value<spanclass="token operator">: </span><ahref="index.html">T</a></span></span><spanclass="token punctuation">)</span></div><divclass="brief "><pclass="paragraph">Multiplies the scalar <ahref="times-assign.html">value</a> by each element of this tensor.</p></div><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword">operator </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="times-assign.html"><spanclass="token function">timesAssign</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">arg<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></span></span><spanclass="token punctuation">)</span></div><divclass="brief "><pclass="paragraph">Each element of the tensor <ahref="times-assign.html">arg</a> is multiplied by each element of this tensor.</p></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-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="../../../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="transposed.html"><spanclass="token function">transposed</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">i<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token operator"> = </span>shape.size - 2<spanclass="token punctuation">, </span></span><spanclass="parameter ">j<spanclass="token operator">: </span><ahref="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a><spanclass="token operator"> = </span>shape.size - 1</span></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></div><divclass="brief "><pclass="paragraph">Returns a tensor that is a transposed version of this tensor. The given dimensions <ahref="transposed.html">i</a> and <ahref="transposed.html">j</a> are swapped. For more information: https://pytorch.org/docs/stable/generated/torch.transpose.html</p></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-content"data-active=""data-togglable=":kmath-tensors:dokkaHtmlPartial/commonMain"><divclass="symbol monospace"><spanclass="token keyword">open </span><spanclass="token keyword"></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="value.html"><spanclass="token function">value</span></a><spanclass="token punctuation">(</span><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="index.html">T</a></div><divclass="brief "><pclass="paragraph">Returns a single tensor value of unit dimension. The tensor shape must be equal to 1.</p></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-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="../../../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="value-or-null.html"><spanclass="token function">valueOrNull</span></a><spanclass="token punctuation">(</span><spanclass="token punctuation">)</span><spanclass="token operator">: </span><ahref="index.html">T</a><spanclass="token operator">?</span></div><divclass="brief "><pclass="paragraph">Returns a single tensor value of unit dimension if tensor shape equals to 1.</p></div></div></div>
<divclass="copy-popup-wrapper "><spanclass="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div>
<divclass="title">
<divclass="platform-hinted "data-platform-hinted="data-platform-hinted"><divclass="content sourceset-dependent-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="view.html"><spanclass="token function">view</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">shape<spanclass="token operator">: </span><ahref="../../../kmath-core/space.kscience.kmath.nd/-shape-n-d/index.html">ShapeND</a></span></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></div><divclass="brief "><pclass="paragraph">Returns a new tensor with the same data as the self tensor but of a different shape. The returned tensor shares the same data and must have the same number of elements, but may have a different size For more information: https://pytorch.org/docs/stable/tensor_view.html</p></div></div></div>