kmath/kmath-tensors/space.kscience.kmath.tensors.api/-tensor-algebra/diagonal-embedding.html

52 lines
8.4 KiB
HTML
Raw Normal View History

<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
<title>diagonalEmbedding</title>
</head><body><link href="../../../../../images/logo-icon.svg" rel="icon" type="image/svg"><script>var pathToRoot = "../../../";</script><script type="text/javascript" src="../../../scripts/sourceset_dependencies.js" async></script><link href="../../../styles/style.css" rel="Stylesheet"><link href="../../../styles/logo-styles.css" rel="Stylesheet"><link href="../../../styles/jetbrains-mono.css" rel="Stylesheet"><link href="../../../styles/main.css" rel="Stylesheet"><script type="text/javascript" src="../../../scripts/clipboard.js" async></script><script type="text/javascript" src="../../../scripts/navigation-loader.js" async></script><script type="text/javascript" src="../../../scripts/platform-content-handler.js" async></script><script type="text/javascript" src="../../../scripts/main.js" async></script>
<div id="container">
<div id="leftColumn"><a href="../../../index.html">
<div id="logo"></div>
</a>
<div id="paneSearch"></div>
<div id="sideMenu"></div>
</div>
<div id="main">
<script type="text/javascript" src="../../../scripts/main.js"></script><div id="leftToggler"><span class="icon-toggler"></span></div>
<div class="main-content" id="content" pageids="kmath-tensors::space.kscience.kmath.tensors.api/TensorAlgebra/diagonalEmbedding/#space.kscience.kmath.nd.MutableStructureND[TypeParam(bounds=[kotlin.Any?])]#kotlin.Int#kotlin.Int#kotlin.Int/PointingToDeclaration//-1345790395">
<div class="navigation-wrapper" id="navigation-wrapper">
<div class="breadcrumbs"><a href="../../index.html">kmath-tensors</a>/<a href="../index.html">space.kscience.kmath.tensors.api</a>/<a href="index.html">TensorAlgebra</a>/<a href="diagonal-embedding.html">diagonalEmbedding</a></div>
<div class="pull-right d-flex">
<div id="searchBar"></div>
</div>
</div>
<div class="cover ">
<h1 class="cover"><span>diagonal</span><wbr><span>Embedding</span></h1>
</div>
<div class="divergent-group" data-filterable-current=":kmath-tensors:dokkaHtmlPartial/commonMain" data-filterable-set=":kmath-tensors:dokkaHtmlPartial/commonMain"><div class="with-platform-tags"><span class="pull-right"></span></div>
<div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":kmath-tensors:dokkaHtmlPartial/commonMain"><div class="symbol monospace">abstract fun <a href="diagonal-embedding.html">diagonalEmbedding</a>(diagonalEntries: <a href="../index.html#-1680022905%2FClasslikes%2F-1345790395">Tensor</a>&lt;<a href="index.html">T</a>&gt;, offset: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a> = 0, dim1: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a> = -2, dim2: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html">Int</a> = -1): <a href="../index.html#-1680022905%2FClasslikes%2F-1345790395">Tensor</a>&lt;<a href="index.html">T</a>&gt;<span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
</div>
<p class="paragraph">Creates a tensor whose diagonals of certain 2D planes (specified by <a href="diagonal-embedding.html">dim1</a> and <a href="diagonal-embedding.html">dim2</a>) are filled by <a href="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><p class="paragraph">The argument <a href="diagonal-embedding.html">offset</a> controls, which diagonal to consider:</p><ol><li><p class="paragraph">If <a href="diagonal-embedding.html">offset</a> = 0, it is the main diagonal.</p></li><li><p class="paragraph">If <a href="diagonal-embedding.html">offset</a> 0, it is above the main diagonal.</p></li><li><p class="paragraph">If <a href="diagonal-embedding.html">offset</a> &lt; 0, it is below the main diagonal.</p></li></ol><p class="paragraph">The size of the new matrix will be calculated to make the specified diagonal of the size of the last input dimension. For more information: https://pytorch.org/docs/stable/generated/torch.diag_embed.html</p><h4 class="">Return</h4><p class="paragraph">tensor whose diagonals of certain 2D planes (specified by <a href="diagonal-embedding.html">dim1</a> and <a href="diagonal-embedding.html">dim2</a>) are filled by <a href="diagonal-embedding.html">diagonalEntries</a></p><h2 class="">Parameters</h2><div data-togglable="Parameters"><div class="platform-hinted WithExtraAttributes" data-platform-hinted="data-platform-hinted" data-togglable="Parameters"><div class="content sourceset-depenent-content" data-active="" data-togglable=":kmath-tensors:dokkaHtmlPartial/commonMain"><div data-togglable="Parameters"><div class="table" data-togglable="Parameters"><div class="table-row" data-filterable-current=":kmath-tensors:dokkaHtmlPartial/commonMain" data-filterable-set=":kmath-tensors:dokkaHtmlPartial/commonMain"><div class="main-subrow keyValue WithExtraAttributes"><div class=""><span class="inline-flex">diagonalEntries</span></div><div><div class="title"><div data-togglable="Parameters"><p class="paragraph">the input tensor. Must be at least 1-dimensional.</p></div></div></div></div></div><div class="table-row" data-filterable-current=":kmath-tensors:dokkaHtmlPartial/commonMain" data-filterable-set=":kmath-tensors:dokkaHtmlPartial/commonMain"><div class="main-subrow keyValue WithExtraAttributes"><div class=""><span class="inline-flex">offset</span></div><div><div class="title"><div data-togglable="Parameters"><p class="paragraph">which diagonal to consider. Default: 0 (main diagonal).</p></div></div></div></div></div><div class="table-row" data-filterable-current=":kmath-tensors:dokkaHtmlPartial/commonMain" data-filterable-set=":kmath-tensors:dokkaHtmlPartial/commonMain"><div class="main-subrow keyValue WithExtraAttributes"><div class=""><span class="inline-flex">dim1</span></div><div><div class="title"><div data-togglable="Parameters"><p class="paragraph">first dimension with respect to which to take diagonal. Default: -2.</p></div></div></div></div></div><div class="table-row" data-filterable-current=":kmath-tensors:dokkaHtmlPartial/commonMain" data-filterable-set=":kmath-tensors:dokkaHtmlPartial/commonMain"><div class="main-subrow keyValue WithExtraAttributes"><div class=""><span class="inline-flex">dim2</span></div><div><div class="title"><div data-togglable="Parameters"><p class="paragraph">second dimension with respect to which to take diagonal. Default: -1.</p></div></div></div></div></div></div></div></div></div></div></div>
<h2 class="">Sources</h2>
<div class="table" data-togglable="Sources"><a data-name="-1962407704%2FSource%2F-1345790395" anchor-label="https://github.com/mipt-npm/kmath/tree/master/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/TensorAlgebra.kt#L230" id="-1962407704%2FSource%2F-1345790395" data-filterable-set=":kmath-tensors:dokkaHtmlPartial/commonMain"></a>
<div class="table-row" data-filterable-current=":kmath-tensors:dokkaHtmlPartial/commonMain" data-filterable-set=":kmath-tensors:dokkaHtmlPartial/commonMain">
<div class="main-subrow keyValue ">
<div class=""><span class="inline-flex"><a href="https://github.com/mipt-npm/kmath/tree/master/kmath-tensors/src/commonMain/kotlin/space/kscience/kmath/tensors/api/TensorAlgebra.kt#L230">common source</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1962407704%2FSource%2F-1345790395"></span>
<div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div></div>
</div>
</div>
</div>
</div>
<div class="footer"><span class="go-to-top-icon"><a href="#content"></a></span><span>© 2021 Copyright</span><span class="pull-right"><span>Generated by </span><a href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span></div>
</div>
</div>
</body></html>