<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="variance.html"><spanclass="token function">variance</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">structureND<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">T</a><spanclass="clearfix"><spanclass="floating-right">(<ahref="https://github.com/SciProgCentre/kmath/tree/master/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/AnalyticTensorAlgebra.kt#L60">source</a>)</span></span></div><spanclass="kdoc-tag"><h4class="">Return</h4><pclass="paragraph">the variance of all elements in the input tensor.</p></span><hr><divclass="symbol monospace"><spanclass="token keyword">abstract </span><spanclass="token keyword"></span><spanclass="token keyword">fun </span><ahref="variance.html"><spanclass="token function">variance</span></a><spanclass="token punctuation">(</span><spanclass="parameters "><spanclass="parameter ">structureND<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 ">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><spanclass="clearfix"><spanclass="floating-right">(<ahref="https://github.com/SciProgCentre/kmath/tree/master/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/AnalyticTensorAlgebra.kt#L73">source</a>)</span></span></div><pclass="paragraph">Returns the variance of each row of the input tensor in the given dimension <ahref="variance.html">dim</a>.</p><pclass="paragraph">If <ahref="variance.html">keepDim</a> is true, the output tensor is of the same size as input except in the dimension <ahref="variance.html">dim</a> where it is of size 1. Otherwise, <ahref="variance.html">dim</a> is squeezed, resulting in the output tensor having 1 fewer dimension.</p><spanclass="kdoc-tag"><h4class="">Return</h4><pclass="paragraph">the variance of each row of the input tensor in the given dimension <ahref="variance.html">dim</a>.</p></span><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>dim</span></span></u></div></span></div><div><divclass="title"><pclass="paragraph">the dimension to reduce.</p></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 ">