|  | <!DOCTYPE html> | 
|  |  | 
|  | <html lang="en"> | 
|  | <head> | 
|  | <meta charset="utf-8"/> | 
|  | <meta content="IE=edge" http-equiv="X-UA-Compatible"/> | 
|  | <meta content="width=device-width, initial-scale=1" name="viewport"/> | 
|  | <title>Linear Algebra NDArray API — mxnet  documentation</title> | 
|  | <link crossorigin="anonymous" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" rel="stylesheet"/> | 
|  | <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"/> | 
|  | <link href="../../../_static/basic.css" rel="stylesheet" type="text/css"/> | 
|  | <link href="../../../_static/pygments.css" rel="stylesheet" type="text/css"/> | 
|  | <link href="../../../_static/mxnet.css" rel="stylesheet" type="text/css"/> | 
|  | <script type="text/javascript"> | 
|  | var DOCUMENTATION_OPTIONS = { | 
|  | URL_ROOT:    '../../../', | 
|  | VERSION:     '', | 
|  | COLLAPSE_INDEX: false, | 
|  | FILE_SUFFIX: '.html', | 
|  | HAS_SOURCE:  true, | 
|  | SOURCELINK_SUFFIX: '' | 
|  | }; | 
|  | </script> | 
|  | <script src="../../../_static/jquery-1.11.1.js" type="text/javascript"></script> | 
|  | <script src="../../../_static/underscore.js" type="text/javascript"></script> | 
|  | <script src="../../../_static/searchtools_custom.js" type="text/javascript"></script> | 
|  | <script src="../../../_static/doctools.js" type="text/javascript"></script> | 
|  | <script src="../../../_static/selectlang.js" type="text/javascript"></script> | 
|  | <script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script> | 
|  | <script type="text/javascript"> jQuery(function() { Search.loadIndex("/searchindex.js"); Search.init();}); </script> | 
|  | <script> | 
|  | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | 
|  | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new | 
|  | Date();a=s.createElement(o), | 
|  | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | 
|  | })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); | 
|  |  | 
|  | ga('create', 'UA-96378503-1', 'auto'); | 
|  | ga('send', 'pageview'); | 
|  |  | 
|  | </script> | 
|  | <!-- --> | 
|  | <!-- <script type="text/javascript" src="../../../_static/jquery.js"></script> --> | 
|  | <!-- --> | 
|  | <!-- <script type="text/javascript" src="../../../_static/underscore.js"></script> --> | 
|  | <!-- --> | 
|  | <!-- <script type="text/javascript" src="../../../_static/doctools.js"></script> --> | 
|  | <!-- --> | 
|  | <!-- <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> --> | 
|  | <!-- --> | 
|  | <link href="../index.html" rel="up" title="MXNet - Python API"> | 
|  | <link href="sparse.html" rel="next" title="Sparse NDArray API"/> | 
|  | <link href="random.html" rel="prev" title="Random Distribution Generator NDArray API"/> | 
|  | <link href="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-icon.png" rel="icon" type="image/png"> | 
|  | </link></link></head> | 
|  | <body background="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet-background-compressed.jpeg" role="document"> | 
|  | <div class="content-block"><div class="navbar navbar-fixed-top"> | 
|  | <div class="container" id="navContainer"> | 
|  | <div class="innder" id="header-inner"> | 
|  | <h1 id="logo-wrap"> | 
|  | <a href="../../../" id="logo"><img src="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/mxnet_logo.png"/></a> | 
|  | </h1> | 
|  | <nav class="nav-bar" id="main-nav"> | 
|  | <a class="main-nav-link" href="../../../install/index.html">Install</a> | 
|  | <a class="main-nav-link" href="../../../tutorials/index.html">Tutorials</a> | 
|  | <span id="dropdown-menu-position-anchor"> | 
|  | <a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">Gluon <span class="caret"></span></a> | 
|  | <ul class="dropdown-menu navbar-menu" id="package-dropdown-menu"> | 
|  | <li><a class="main-nav-link" href="../../../gluon/index.html">About</a></li> | 
|  | <li><a class="main-nav-link" href="http://gluon.mxnet.io">Tutorials</a></li> | 
|  | </ul> | 
|  | </span> | 
|  | <span id="dropdown-menu-position-anchor"> | 
|  | <a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">API <span class="caret"></span></a> | 
|  | <ul class="dropdown-menu navbar-menu" id="package-dropdown-menu"> | 
|  | <li><a class="main-nav-link" href="../../../api/python/index.html">Python</a></li> | 
|  | <li><a class="main-nav-link" href="../../../api/scala/index.html">Scala</a></li> | 
|  | <li><a class="main-nav-link" href="../../../api/r/index.html">R</a></li> | 
|  | <li><a class="main-nav-link" href="../../../api/julia/index.html">Julia</a></li> | 
|  | <li><a class="main-nav-link" href="../../../api/c++/index.html">C++</a></li> | 
|  | <li><a class="main-nav-link" href="../../../api/perl/index.html">Perl</a></li> | 
|  | </ul> | 
|  | </span> | 
|  | <span id="dropdown-menu-position-anchor-docs"> | 
|  | <a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">Docs <span class="caret"></span></a> | 
|  | <ul class="dropdown-menu navbar-menu" id="package-dropdown-menu-docs"> | 
|  | <li><a class="main-nav-link" href="../../../faq/index.html">FAQ</a></li> | 
|  | <li><a class="main-nav-link" href="../../../architecture/index.html">Architecture</a></li> | 
|  | <li><a class="main-nav-link" href="https://github.com/apache/incubator-mxnet/tree/0.12.0/example">Examples</a></li> | 
|  | <li><a class="main-nav-link" href="../../../model_zoo/index.html">Model Zoo</a></li> | 
|  | </ul> | 
|  | </span> | 
|  | <a class="main-nav-link" href="https://github.com/dmlc/mxnet">Github</a> | 
|  | <span id="dropdown-menu-position-anchor-community"> | 
|  | <a aria-expanded="true" aria-haspopup="true" class="main-nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button">Community <span class="caret"></span></a> | 
|  | <ul class="dropdown-menu navbar-menu" id="package-dropdown-menu-community"> | 
|  | <li><a class="main-nav-link" href="../../../community/index.html">Community</a></li> | 
|  | <li><a class="main-nav-link" href="../../../community/contribute.html">Contribute</a></li> | 
|  | <li><a class="main-nav-link" href="../../../community/powered_by.html">Powered By</a></li> | 
|  | </ul> | 
|  | </span> | 
|  | <a class="main-nav-link" href="http://discuss.mxnet.io">Discuss</a> | 
|  | <span id="dropdown-menu-position-anchor-version" style="position: relative"><a href="#" class="main-nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true">Versions(0.12.0)<span class="caret"></span></a><ul id="package-dropdown-menu" class="dropdown-menu"><li><a class="main-nav-link" href=https://mxnet.incubator.apache.org/>1.0.0</a></li><li><a class="main-nav-link" href=https://mxnet.incubator.apache.org/versions/0.12.1/index.html>0.12.1</a></li><li><a class="main-nav-link" href=https://mxnet.incubator.apache.org/versions/0.12.0/index.html>0.12.0</a></li><li><a class="main-nav-link" href=https://mxnet.incubator.apache.org/versions/0.11.0/index.html>0.11.0</a></li><li><a class="main-nav-link" href=https://mxnet.incubator.apache.org/versions/master/index.html>master</a></li></ul></span></nav> | 
|  | <script> function getRootPath(){ return "../../../" } </script> | 
|  | <div class="burgerIcon dropdown"> | 
|  | <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">☰</a> | 
|  | <ul class="dropdown-menu" id="burgerMenu"> | 
|  | <li><a href="../../../install/index.html">Install</a></li> | 
|  | <li><a class="main-nav-link" href="../../../tutorials/index.html">Tutorials</a></li> | 
|  | <li class="dropdown-submenu"> | 
|  | <a href="#" tabindex="-1">Community</a> | 
|  | <ul class="dropdown-menu"> | 
|  | <li><a href="../../../community/index.html" tabindex="-1">Community</a></li> | 
|  | <li><a href="../../../community/contribute.html" tabindex="-1">Contribute</a></li> | 
|  | <li><a href="../../../community/powered_by.html" tabindex="-1">Powered By</a></li> | 
|  | </ul> | 
|  | </li> | 
|  | <li class="dropdown-submenu"> | 
|  | <a href="#" tabindex="-1">API</a> | 
|  | <ul class="dropdown-menu"> | 
|  | <li><a href="../../../api/python/index.html" tabindex="-1">Python</a> | 
|  | </li> | 
|  | <li><a href="../../../api/scala/index.html" tabindex="-1">Scala</a> | 
|  | </li> | 
|  | <li><a href="../../../api/r/index.html" tabindex="-1">R</a> | 
|  | </li> | 
|  | <li><a href="../../../api/julia/index.html" tabindex="-1">Julia</a> | 
|  | </li> | 
|  | <li><a href="../../../api/c++/index.html" tabindex="-1">C++</a> | 
|  | </li> | 
|  | <li><a href="../../../api/perl/index.html" tabindex="-1">Perl</a> | 
|  | </li> | 
|  | </ul> | 
|  | </li> | 
|  | <li class="dropdown-submenu"> | 
|  | <a href="#" tabindex="-1">Docs</a> | 
|  | <ul class="dropdown-menu"> | 
|  | <li><a href="../../../tutorials/index.html" tabindex="-1">Tutorials</a></li> | 
|  | <li><a href="../../../faq/index.html" tabindex="-1">FAQ</a></li> | 
|  | <li><a href="../../../architecture/index.html" tabindex="-1">Architecture</a></li> | 
|  | <li><a href="https://github.com/apache/incubator-mxnet/tree/0.12.0/example" tabindex="-1">Examples</a></li> | 
|  | <li><a href="../../../model_zoo/index.html" tabindex="-1">Model Zoo</a></li> | 
|  | </ul> | 
|  | </li> | 
|  | <li><a href="../../../architecture/index.html">Architecture</a></li> | 
|  | <li><a class="main-nav-link" href="https://github.com/dmlc/mxnet">Github</a></li> | 
|  | <li id="dropdown-menu-position-anchor-version-mobile" class="dropdown-submenu" style="position: relative"><a href="#" tabindex="-1">Versions(0.12.0)</a><ul class="dropdown-menu"><li><a tabindex="-1" href=https://mxnet.incubator.apache.org/>1.0.0</a></li><li><a tabindex="-1" href=https://mxnet.incubator.apache.org/versions/0.12.1/index.html>0.12.1</a></li><li><a tabindex="-1" href=https://mxnet.incubator.apache.org/versions/0.12.0/index.html>0.12.0</a></li><li><a tabindex="-1" href=https://mxnet.incubator.apache.org/versions/0.11.0/index.html>0.11.0</a></li><li><a tabindex="-1" href=https://mxnet.incubator.apache.org/versions/master/index.html>master</a></li></ul></li></ul> | 
|  | </div> | 
|  | <div class="plusIcon dropdown"> | 
|  | <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button"><span aria-hidden="true" class="glyphicon glyphicon-plus"></span></a> | 
|  | <ul class="dropdown-menu dropdown-menu-right" id="plusMenu"></ul> | 
|  | </div> | 
|  | <div id="search-input-wrap"> | 
|  | <form action="../../../search.html" autocomplete="off" class="" method="get" role="search"> | 
|  | <div class="form-group inner-addon left-addon"> | 
|  | <i class="glyphicon glyphicon-search"></i> | 
|  | <input class="form-control" name="q" placeholder="Search" type="text"/> | 
|  | </div> | 
|  | <input name="check_keywords" type="hidden" value="yes"/> | 
|  | <input name="area" type="hidden" value="default"/> | 
|  | </form> | 
|  | <div id="search-preview"></div> | 
|  | </div> | 
|  | <div id="searchIcon"> | 
|  | <span aria-hidden="true" class="glyphicon glyphicon-search"></span> | 
|  | </div> | 
|  | <!-- <div id="lang-select-wrap"> --> | 
|  | <!--   <label id="lang-select-label"> --> | 
|  | <!--     <\!-- <i class="fa fa-globe"></i> -\-> --> | 
|  | <!--     <span></span> --> | 
|  | <!--   </label> --> | 
|  | <!--   <select id="lang-select"> --> | 
|  | <!--     <option value="en">Eng</option> --> | 
|  | <!--     <option value="zh">中文</option> --> | 
|  | <!--   </select> --> | 
|  | <!-- </div> --> | 
|  | <!--     <a id="mobile-nav-toggle"> | 
|  | <span class="mobile-nav-toggle-bar"></span> | 
|  | <span class="mobile-nav-toggle-bar"></span> | 
|  | <span class="mobile-nav-toggle-bar"></span> | 
|  | </a> --> | 
|  | </div> | 
|  | </div> | 
|  | </div> | 
|  | <script type="text/javascript"> | 
|  | $('body').css('background', 'white'); | 
|  | </script> | 
|  | <div class="container"> | 
|  | <div class="row"> | 
|  | <div aria-label="main navigation" class="sphinxsidebar leftsidebar" role="navigation"> | 
|  | <div class="sphinxsidebarwrapper"> | 
|  | <ul class="current"> | 
|  | <li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python Documents</a><ul class="current"> | 
|  | <li class="toctree-l2 current"><a class="reference internal" href="../index.html#ndarray-api">NDArray API</a><ul class="current"> | 
|  | <li class="toctree-l3"><a class="reference internal" href="ndarray.html">NDArray API</a></li> | 
|  | <li class="toctree-l3"><a class="reference internal" href="random.html">Random Distribution Generator NDArray API</a></li> | 
|  | <li class="toctree-l3 current"><a class="current reference internal" href="">Linear Algebra NDArray API</a><ul> | 
|  | <li class="toctree-l4"><a class="reference internal" href="#overview">Overview</a></li> | 
|  | <li class="toctree-l4"><a class="reference internal" href="#linear-algebra">Linear Algebra</a></li> | 
|  | <li class="toctree-l4"><a class="reference internal" href="#api-reference">API Reference</a></li> | 
|  | </ul> | 
|  | </li> | 
|  | <li class="toctree-l3"><a class="reference internal" href="sparse.html">Sparse NDArray API</a></li> | 
|  | <li class="toctree-l3"><a class="reference internal" href="contrib.html">Contrib NDArray API</a></li> | 
|  | </ul> | 
|  | </li> | 
|  | <li class="toctree-l2"><a class="reference internal" href="../index.html#symbol-api">Symbol API</a></li> | 
|  | <li class="toctree-l2"><a class="reference internal" href="../index.html#module-api">Module API</a></li> | 
|  | <li class="toctree-l2"><a class="reference internal" href="../index.html#autograd-api">Autograd API</a></li> | 
|  | <li class="toctree-l2"><a class="reference internal" href="../index.html#gluon-api">Gluon API</a></li> | 
|  | <li class="toctree-l2"><a class="reference internal" href="../index.html#kvstore-api">KVStore API</a></li> | 
|  | <li class="toctree-l2"><a class="reference internal" href="../index.html#io-api">IO API</a></li> | 
|  | <li class="toctree-l2"><a class="reference internal" href="../index.html#image-api">Image API</a></li> | 
|  | <li class="toctree-l2"><a class="reference internal" href="../index.html#optimization-api">Optimization API</a></li> | 
|  | <li class="toctree-l2"><a class="reference internal" href="../index.html#callback-api">Callback API</a></li> | 
|  | <li class="toctree-l2"><a class="reference internal" href="../index.html#metric-api">Metric API</a></li> | 
|  | <li class="toctree-l2"><a class="reference internal" href="../index.html#run-time-compilation-api">Run-Time Compilation API</a></li> | 
|  | </ul> | 
|  | </li> | 
|  | <li class="toctree-l1"><a class="reference internal" href="../../r/index.html">R Documents</a></li> | 
|  | <li class="toctree-l1"><a class="reference internal" href="../../julia/index.html">Julia Documents</a></li> | 
|  | <li class="toctree-l1"><a class="reference internal" href="../../c++/index.html">C++ Documents</a></li> | 
|  | <li class="toctree-l1"><a class="reference internal" href="../../scala/index.html">Scala Documents</a></li> | 
|  | <li class="toctree-l1"><a class="reference internal" href="../../perl/index.html">Perl Documents</a></li> | 
|  | <li class="toctree-l1"><a class="reference internal" href="../../../faq/index.html">HowTo Documents</a></li> | 
|  | <li class="toctree-l1"><a class="reference internal" href="../../../architecture/index.html">System Documents</a></li> | 
|  | <li class="toctree-l1"><a class="reference internal" href="../../../tutorials/index.html">Tutorials</a></li> | 
|  | <li class="toctree-l1"><a class="reference internal" href="../../../community/index.html">Community</a></li> | 
|  | </ul> | 
|  | </div> | 
|  | </div> | 
|  | <div class="content"> | 
|  | <div class="page-tracker"></div> | 
|  | <div class="section" id="linear-algebra-ndarray-api"> | 
|  | <span id="linear-algebra-ndarray-api"></span><h1>Linear Algebra NDArray API<a class="headerlink" href="#linear-algebra-ndarray-api" title="Permalink to this headline">¶</a></h1> | 
|  | <div class="section" id="overview"> | 
|  | <span id="overview"></span><h2>Overview<a class="headerlink" href="#overview" title="Permalink to this headline">¶</a></h2> | 
|  | <p>This document lists the linear algebra routines of the <em>n</em>-dimensional array package:</p> | 
|  | <table border="1" class="longtable docutils"> | 
|  | <colgroup> | 
|  | <col width="10%"/> | 
|  | <col width="90%"/> | 
|  | </colgroup> | 
|  | <tbody valign="top"> | 
|  | <tr class="row-odd"><td><a class="reference internal" href="#module-mxnet.ndarray.linalg" title="mxnet.ndarray.linalg"><code class="xref py py-obj docutils literal"><span class="pre">mxnet.ndarray.linalg</span></code></a></td> | 
|  | <td>Linear Algebra NDArray API of MXNet.</td> | 
|  | </tr> | 
|  | </tbody> | 
|  | </table> | 
|  | <p>The <code class="docutils literal"><span class="pre">Linear</span> <span class="pre">Algebra</span> <span class="pre">NDArray</span></code> API, defined in the <code class="docutils literal"><span class="pre">ndarray.linalg</span></code> package, provides | 
|  | imperative linear algebra tensor operations on CPU/GPU.</p> | 
|  | <p>In the rest of this document, we list routines provided by the <code class="docutils literal"><span class="pre">ndarray.linalg</span></code> package.</p> | 
|  | </div> | 
|  | <div class="section" id="linear-algebra"> | 
|  | <span id="linear-algebra"></span><h2>Linear Algebra<a class="headerlink" href="#linear-algebra" title="Permalink to this headline">¶</a></h2> | 
|  | <table border="1" class="longtable docutils"> | 
|  | <colgroup> | 
|  | <col width="10%"/> | 
|  | <col width="90%"/> | 
|  | </colgroup> | 
|  | <tbody valign="top"> | 
|  | <tr class="row-odd"><td><a class="reference internal" href="#mxnet.ndarray.linalg.gemm" title="mxnet.ndarray.linalg.gemm"><code class="xref py py-obj docutils literal"><span class="pre">gemm</span></code></a></td> | 
|  | <td>Performs general matrix multiplication and accumulation.</td> | 
|  | </tr> | 
|  | <tr class="row-even"><td><a class="reference internal" href="#mxnet.ndarray.linalg.gemm2" title="mxnet.ndarray.linalg.gemm2"><code class="xref py py-obj docutils literal"><span class="pre">gemm2</span></code></a></td> | 
|  | <td>Performs general matrix multiplication.</td> | 
|  | </tr> | 
|  | <tr class="row-odd"><td><a class="reference internal" href="#mxnet.ndarray.linalg.potrf" title="mxnet.ndarray.linalg.potrf"><code class="xref py py-obj docutils literal"><span class="pre">potrf</span></code></a></td> | 
|  | <td>Performs Cholesky factorization of a symmetric positive-definite matrix.</td> | 
|  | </tr> | 
|  | <tr class="row-even"><td><a class="reference internal" href="#mxnet.ndarray.linalg.potri" title="mxnet.ndarray.linalg.potri"><code class="xref py py-obj docutils literal"><span class="pre">potri</span></code></a></td> | 
|  | <td>Performs matrix inversion from a Cholesky factorization.</td> | 
|  | </tr> | 
|  | <tr class="row-odd"><td><a class="reference internal" href="#mxnet.ndarray.linalg.trmm" title="mxnet.ndarray.linalg.trmm"><code class="xref py py-obj docutils literal"><span class="pre">trmm</span></code></a></td> | 
|  | <td>Performs multiplication with a lower triangular matrix.</td> | 
|  | </tr> | 
|  | <tr class="row-even"><td><a class="reference internal" href="#mxnet.ndarray.linalg.trsm" title="mxnet.ndarray.linalg.trsm"><code class="xref py py-obj docutils literal"><span class="pre">trsm</span></code></a></td> | 
|  | <td>Solves matrix equation involving a lower triangular matrix.</td> | 
|  | </tr> | 
|  | <tr class="row-odd"><td><a class="reference internal" href="#mxnet.ndarray.linalg.sumlogdiag" title="mxnet.ndarray.linalg.sumlogdiag"><code class="xref py py-obj docutils literal"><span class="pre">sumlogdiag</span></code></a></td> | 
|  | <td>Computes the sum of the logarithms of the diagonal elements of a square matrix.</td> | 
|  | </tr> | 
|  | <tr class="row-even"><td><a class="reference internal" href="#mxnet.ndarray.linalg.syrk" title="mxnet.ndarray.linalg.syrk"><code class="xref py py-obj docutils literal"><span class="pre">syrk</span></code></a></td> | 
|  | <td>Multiplication of matrix with its transpose.</td> | 
|  | </tr> | 
|  | <tr class="row-odd"><td><a class="reference internal" href="#mxnet.ndarray.linalg.gelqf" title="mxnet.ndarray.linalg.gelqf"><code class="xref py py-obj docutils literal"><span class="pre">gelqf</span></code></a></td> | 
|  | <td>LQ factorization for general matrix.</td> | 
|  | </tr> | 
|  | <tr class="row-even"><td><a class="reference internal" href="#mxnet.ndarray.linalg.syevd" title="mxnet.ndarray.linalg.syevd"><code class="xref py py-obj docutils literal"><span class="pre">syevd</span></code></a></td> | 
|  | <td>Eigendecomposition for symmetric matrix.</td> | 
|  | </tr> | 
|  | </tbody> | 
|  | </table> | 
|  | </div> | 
|  | <div class="section" id="api-reference"> | 
|  | <span id="api-reference"></span><h2>API Reference<a class="headerlink" href="#api-reference" title="Permalink to this headline">¶</a></h2> | 
|  | <script src="../../../_static/js/auto_module_index.js" type="text/javascript"></script><span class="target" id="module-mxnet.ndarray.linalg"></span><p>Linear Algebra NDArray API of MXNet.</p> | 
|  | <dl class="function"> | 
|  | <dt id="mxnet.ndarray.linalg.gelqf"> | 
|  | <code class="descclassname">mxnet.ndarray.linalg.</code><code class="descname">gelqf</code><span class="sig-paren">(</span><em>A=None</em>, <em>out=None</em>, <em>name=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.ndarray.linalg.gelqf" title="Permalink to this definition">¶</a></dt> | 
|  | <dd><p>LQ factorization for general matrix. | 
|  | Input is a tensor <em>A</em> of dimension <em>n >= 2</em>.</p> | 
|  | <p>If <em>n=2</em>, we compute the LQ factorization (LAPACK <em>gelqf</em>, followed by <em>orglq</em>). <em>A</em> | 
|  | must have shape <em>(x, y)</em> with <em>x <= y</em>, and must have full rank <em>=x</em>. The LQ | 
|  | factorization consists of <em>L</em> with shape <em>(x, x)</em> and <em>Q</em> with shape <em>(x, y)</em>, so | 
|  | that:</p> | 
|  | <blockquote> | 
|  | <div><em>A</em> = <em>L</em> * <em>Q</em></div></blockquote> | 
|  | <p>Here, <em>L</em> is lower triangular (upper triangle equal to zero) with nonzero diagonal, | 
|  | and <em>Q</em> is row-orthonormal, meaning that</p> | 
|  | <blockquote> | 
|  | <div><em>Q</em> * <em>Q</em><sup>T</sup></div></blockquote> | 
|  | <p>is equal to the identity matrix of shape <em>(x, x)</em>.</p> | 
|  | <p>If <em>n>2</em>, <em>gelqf</em> is performed separately on the trailing two dimensions for all | 
|  | inputs (batch mode).</p> | 
|  | <div class="admonition note"> | 
|  | <p class="first admonition-title">Note</p> | 
|  | <p class="last">The operator supports float32 and float64 data types only.</p> | 
|  | </div> | 
|  | <p>Examples:</p> | 
|  | <div class="highlight-python"><div class="highlight"><pre><span></span>// Single LQ factorization | 
|  | A = [[1., 2., 3.], [4., 5., 6.]] | 
|  | Q, L = gelqf(A) | 
|  | Q = [[-0.26726124, -0.53452248, -0.80178373], | 
|  | [0.87287156, 0.21821789, -0.43643578]] | 
|  | L = [[-3.74165739, 0.], | 
|  | [-8.55235974, 1.96396101]] | 
|  |  | 
|  | // Batch LQ factorization | 
|  | A = [[[1., 2., 3.], [4., 5., 6.]], | 
|  | [[7., 8., 9.], [10., 11., 12.]]] | 
|  | Q, L = gelqf(A) | 
|  | Q = [[[-0.26726124, -0.53452248, -0.80178373], | 
|  | [0.87287156, 0.21821789, -0.43643578]], | 
|  | [[-0.50257071, -0.57436653, -0.64616234], | 
|  | [0.7620735, 0.05862104, -0.64483142]]] | 
|  | L = [[[-3.74165739, 0.], | 
|  | [-8.55235974, 1.96396101]], | 
|  | [[-13.92838828, 0.], | 
|  | [-19.09768702, 0.52758934]]] | 
|  | </pre></div> | 
|  | </div> | 
|  | <p>Defined in src/operator/tensor/la_op.cc:L528</p> | 
|  | <table class="docutils field-list" frame="void" rules="none"> | 
|  | <col class="field-name"/> | 
|  | <col class="field-body"/> | 
|  | <tbody valign="top"> | 
|  | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | 
|  | <li><strong>A</strong> (<a class="reference internal" href="ndarray.html#mxnet.ndarray.NDArray" title="mxnet.ndarray.NDArray"><em>NDArray</em></a>) – Tensor of input matrices to be factorized</li> | 
|  | <li><strong>out</strong> (<em>NDArray, optional</em>) – The output NDArray to hold the result.</li> | 
|  | </ul> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>out</strong> – | 
|  | The output of this function.</p> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">NDArray or list of NDArrays</p> | 
|  | </td> | 
|  | </tr> | 
|  | </tbody> | 
|  | </table> | 
|  | </dd></dl> | 
|  | <dl class="function"> | 
|  | <dt id="mxnet.ndarray.linalg.gemm"> | 
|  | <code class="descclassname">mxnet.ndarray.linalg.</code><code class="descname">gemm</code><span class="sig-paren">(</span><em>A=None</em>, <em>B=None</em>, <em>C=None</em>, <em>transpose_a=_Null</em>, <em>transpose_b=_Null</em>, <em>alpha=_Null</em>, <em>beta=_Null</em>, <em>out=None</em>, <em>name=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.ndarray.linalg.gemm" title="Permalink to this definition">¶</a></dt> | 
|  | <dd><p>Performs general matrix multiplication and accumulation. | 
|  | Input are tensors <em>A</em>, <em>B</em>, <em>C</em>, each of dimension <em>n >= 2</em> and having the same shape | 
|  | on the leading <em>n-2</em> dimensions.</p> | 
|  | <p>If <em>n=2</em>, the BLAS3 function <em>gemm</em> is performed:</p> | 
|  | <blockquote> | 
|  | <div><em>out</em> = <em>alpha</em> * <em>op</em>(<em>A</em>) * <em>op</em>(<em>B</em>) + <em>beta</em> * <em>C</em></div></blockquote> | 
|  | <p>Here, <em>alpha</em> and <em>beta</em> are scalar parameters, and <em>op()</em> is either the identity or | 
|  | matrix transposition (depending on <em>transpose_a</em>, <em>transpose_b</em>).</p> | 
|  | <p>If <em>n>2</em>, <em>gemm</em> is performed separately on the trailing two dimensions for all inputs | 
|  | (batch mode).</p> | 
|  | <div class="admonition note"> | 
|  | <p class="first admonition-title">Note</p> | 
|  | <p class="last">The operator supports float32 and float64 data types only.</p> | 
|  | </div> | 
|  | <p>Examples:</p> | 
|  | <div class="highlight-python"><div class="highlight"><pre><span></span>// Single matrix multiply-add | 
|  | A = [[1.0, 1.0], [1.0, 1.0]] | 
|  | B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]] | 
|  | C = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]] | 
|  | gemm(A, B, C, transpose_b=True, alpha=2.0, beta=10.0) | 
|  | = [[14.0, 14.0, 14.0], [14.0, 14.0, 14.0]] | 
|  |  | 
|  | // Batch matrix multiply-add | 
|  | A = [[[1.0, 1.0]], [[0.1, 0.1]]] | 
|  | B = [[[1.0, 1.0]], [[0.1, 0.1]]] | 
|  | C = [[[10.0]], [[0.01]]] | 
|  | gemm(A, B, C, transpose_b=True, alpha=2.0 , beta=10.0) | 
|  | = [[[104.0]], [[0.14]]] | 
|  | </pre></div> | 
|  | </div> | 
|  | <p>Defined in src/operator/tensor/la_op.cc:L68</p> | 
|  | <table class="docutils field-list" frame="void" rules="none"> | 
|  | <col class="field-name"/> | 
|  | <col class="field-body"/> | 
|  | <tbody valign="top"> | 
|  | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | 
|  | <li><strong>A</strong> (<a class="reference internal" href="ndarray.html#mxnet.ndarray.NDArray" title="mxnet.ndarray.NDArray"><em>NDArray</em></a>) – Tensor of input matrices</li> | 
|  | <li><strong>B</strong> (<a class="reference internal" href="ndarray.html#mxnet.ndarray.NDArray" title="mxnet.ndarray.NDArray"><em>NDArray</em></a>) – Tensor of input matrices</li> | 
|  | <li><strong>C</strong> (<a class="reference internal" href="ndarray.html#mxnet.ndarray.NDArray" title="mxnet.ndarray.NDArray"><em>NDArray</em></a>) – Tensor of input matrices</li> | 
|  | <li><strong>transpose_a</strong> (<em>boolean, optional, default=0</em>) – Multiply with transposed of first input (A).</li> | 
|  | <li><strong>transpose_b</strong> (<em>boolean, optional, default=0</em>) – Multiply with transposed of second input (B).</li> | 
|  | <li><strong>alpha</strong> (<em>double, optional, default=1</em>) – Scalar factor multiplied with A*B.</li> | 
|  | <li><strong>beta</strong> (<em>double, optional, default=1</em>) – Scalar factor multiplied with C.</li> | 
|  | <li><strong>out</strong> (<em>NDArray, optional</em>) – The output NDArray to hold the result.</li> | 
|  | </ul> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>out</strong> – | 
|  | The output of this function.</p> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">NDArray or list of NDArrays</p> | 
|  | </td> | 
|  | </tr> | 
|  | </tbody> | 
|  | </table> | 
|  | </dd></dl> | 
|  | <dl class="function"> | 
|  | <dt id="mxnet.ndarray.linalg.gemm2"> | 
|  | <code class="descclassname">mxnet.ndarray.linalg.</code><code class="descname">gemm2</code><span class="sig-paren">(</span><em>A=None</em>, <em>B=None</em>, <em>transpose_a=_Null</em>, <em>transpose_b=_Null</em>, <em>alpha=_Null</em>, <em>out=None</em>, <em>name=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.ndarray.linalg.gemm2" title="Permalink to this definition">¶</a></dt> | 
|  | <dd><p>Performs general matrix multiplication. | 
|  | Input are tensors <em>A</em>, <em>B</em>, each of dimension <em>n >= 2</em> and having the same shape | 
|  | on the leading <em>n-2</em> dimensions.</p> | 
|  | <p>If <em>n=2</em>, the BLAS3 function <em>gemm</em> is performed:</p> | 
|  | <blockquote> | 
|  | <div><em>out</em> = <em>alpha</em> * <em>op</em>(<em>A</em>) * <em>op</em>(<em>B</em>)</div></blockquote> | 
|  | <p>Here <em>alpha</em> is a scalar parameter and <em>op()</em> is either the identity or the matrix | 
|  | transposition (depending on <em>transpose_a</em>, <em>transpose_b</em>).</p> | 
|  | <p>If <em>n>2</em>, <em>gemm</em> is performed separately on the trailing two dimensions for all inputs | 
|  | (batch mode).</p> | 
|  | <div class="admonition note"> | 
|  | <p class="first admonition-title">Note</p> | 
|  | <p class="last">The operator supports float32 and float64 data types only.</p> | 
|  | </div> | 
|  | <p>Examples:</p> | 
|  | <div class="highlight-python"><div class="highlight"><pre><span></span>// Single matrix multiply | 
|  | A = [[1.0, 1.0], [1.0, 1.0]] | 
|  | B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]] | 
|  | gemm2(A, B, transpose_b=True, alpha=2.0) | 
|  | = [[4.0, 4.0, 4.0], [4.0, 4.0, 4.0]] | 
|  |  | 
|  | // Batch matrix multiply | 
|  | A = [[[1.0, 1.0]], [[0.1, 0.1]]] | 
|  | B = [[[1.0, 1.0]], [[0.1, 0.1]]] | 
|  | gemm2(A, B, transpose_b=True, alpha=2.0) | 
|  | = [[[4.0]], [[0.04 ]]] | 
|  | </pre></div> | 
|  | </div> | 
|  | <p>Defined in src/operator/tensor/la_op.cc:L127</p> | 
|  | <table class="docutils field-list" frame="void" rules="none"> | 
|  | <col class="field-name"/> | 
|  | <col class="field-body"/> | 
|  | <tbody valign="top"> | 
|  | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | 
|  | <li><strong>A</strong> (<a class="reference internal" href="ndarray.html#mxnet.ndarray.NDArray" title="mxnet.ndarray.NDArray"><em>NDArray</em></a>) – Tensor of input matrices</li> | 
|  | <li><strong>B</strong> (<a class="reference internal" href="ndarray.html#mxnet.ndarray.NDArray" title="mxnet.ndarray.NDArray"><em>NDArray</em></a>) – Tensor of input matrices</li> | 
|  | <li><strong>transpose_a</strong> (<em>boolean, optional, default=0</em>) – Multiply with transposed of first input (A).</li> | 
|  | <li><strong>transpose_b</strong> (<em>boolean, optional, default=0</em>) – Multiply with transposed of second input (B).</li> | 
|  | <li><strong>alpha</strong> (<em>double, optional, default=1</em>) – Scalar factor multiplied with A*B.</li> | 
|  | <li><strong>out</strong> (<em>NDArray, optional</em>) – The output NDArray to hold the result.</li> | 
|  | </ul> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>out</strong> – | 
|  | The output of this function.</p> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">NDArray or list of NDArrays</p> | 
|  | </td> | 
|  | </tr> | 
|  | </tbody> | 
|  | </table> | 
|  | </dd></dl> | 
|  | <dl class="function"> | 
|  | <dt id="mxnet.ndarray.linalg.potrf"> | 
|  | <code class="descclassname">mxnet.ndarray.linalg.</code><code class="descname">potrf</code><span class="sig-paren">(</span><em>A=None</em>, <em>out=None</em>, <em>name=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.ndarray.linalg.potrf" title="Permalink to this definition">¶</a></dt> | 
|  | <dd><p>Performs Cholesky factorization of a symmetric positive-definite matrix. | 
|  | Input is a tensor <em>A</em> of dimension <em>n >= 2</em>.</p> | 
|  | <p>If <em>n=2</em>, the Cholesky factor <em>L</em> of the symmetric, positive definite matrix <em>A</em> is | 
|  | computed. <em>L</em> is lower triangular (entries of upper triangle are all zero), has | 
|  | positive diagonal entries, and:</p> | 
|  | <blockquote> | 
|  | <div><em>A</em> = <em>L</em> * <em>L</em><sup>T</sup></div></blockquote> | 
|  | <p>If <em>n>2</em>, <em>potrf</em> is performed separately on the trailing two dimensions for all inputs | 
|  | (batch mode).</p> | 
|  | <div class="admonition note"> | 
|  | <p class="first admonition-title">Note</p> | 
|  | <p class="last">The operator supports float32 and float64 data types only.</p> | 
|  | </div> | 
|  | <p>Examples:</p> | 
|  | <div class="highlight-python"><div class="highlight"><pre><span></span>// Single matrix factorization | 
|  | A = [[4.0, 1.0], [1.0, 4.25]] | 
|  | potrf(A) = [[2.0, 0], [0.5, 2.0]] | 
|  |  | 
|  | // Batch matrix factorization | 
|  | A = [[[4.0, 1.0], [1.0, 4.25]], [[16.0, 4.0], [4.0, 17.0]]] | 
|  | potrf(A) = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]] | 
|  | </pre></div> | 
|  | </div> | 
|  | <p>Defined in src/operator/tensor/la_op.cc:L177</p> | 
|  | <table class="docutils field-list" frame="void" rules="none"> | 
|  | <col class="field-name"/> | 
|  | <col class="field-body"/> | 
|  | <tbody valign="top"> | 
|  | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | 
|  | <li><strong>A</strong> (<a class="reference internal" href="ndarray.html#mxnet.ndarray.NDArray" title="mxnet.ndarray.NDArray"><em>NDArray</em></a>) – Tensor of input matrices to be decomposed</li> | 
|  | <li><strong>out</strong> (<em>NDArray, optional</em>) – The output NDArray to hold the result.</li> | 
|  | </ul> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>out</strong> – | 
|  | The output of this function.</p> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">NDArray or list of NDArrays</p> | 
|  | </td> | 
|  | </tr> | 
|  | </tbody> | 
|  | </table> | 
|  | </dd></dl> | 
|  | <dl class="function"> | 
|  | <dt id="mxnet.ndarray.linalg.potri"> | 
|  | <code class="descclassname">mxnet.ndarray.linalg.</code><code class="descname">potri</code><span class="sig-paren">(</span><em>A=None</em>, <em>out=None</em>, <em>name=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.ndarray.linalg.potri" title="Permalink to this definition">¶</a></dt> | 
|  | <dd><p>Performs matrix inversion from a Cholesky factorization. | 
|  | Input is a tensor <em>A</em> of dimension <em>n >= 2</em>.</p> | 
|  | <p>If <em>n=2</em>, <em>A</em> is a lower triangular matrix (entries of upper triangle are all zero) | 
|  | with positive diagonal. We compute:</p> | 
|  | <blockquote> | 
|  | <div><em>out</em> = <em>A</em><sup>-T</sup> * <em>A</em><sup>-1</sup></div></blockquote> | 
|  | <p>In other words, if <em>A</em> is the Cholesky factor of a symmetric positive definite matrix | 
|  | <em>B</em> (obtained by <em>potrf</em>), then</p> | 
|  | <blockquote> | 
|  | <div><em>out</em> = <em>B</em><sup>-1</sup></div></blockquote> | 
|  | <p>If <em>n>2</em>, <em>potri</em> is performed separately on the trailing two dimensions for all inputs | 
|  | (batch mode).</p> | 
|  | <div class="admonition note"> | 
|  | <p class="first admonition-title">Note</p> | 
|  | <p class="last">The operator supports float32 and float64 data types only.</p> | 
|  | </div> | 
|  | <div class="admonition note"> | 
|  | <p class="first admonition-title">Note</p> | 
|  | <p class="last">Use this operator only if you are certain you need the inverse of <em>B</em>, and | 
|  | cannot use the Cholesky factor <em>A</em> (<em>potrf</em>), together with backsubstitution | 
|  | (<em>trsm</em>). The latter is numerically much safer, and also cheaper.</p> | 
|  | </div> | 
|  | <p>Examples:</p> | 
|  | <div class="highlight-python"><div class="highlight"><pre><span></span>// Single matrix inverse | 
|  | A = [[2.0, 0], [0.5, 2.0]] | 
|  | potri(A) = [[0.26563, -0.0625], [-0.0625, 0.25]] | 
|  |  | 
|  | // Batch matrix inverse | 
|  | A = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]] | 
|  | potri(A) = [[[0.26563, -0.0625], [-0.0625, 0.25]], | 
|  | [[0.06641, -0.01562], [-0.01562, 0,0625]]] | 
|  | </pre></div> | 
|  | </div> | 
|  | <p>Defined in src/operator/tensor/la_op.cc:L235</p> | 
|  | <table class="docutils field-list" frame="void" rules="none"> | 
|  | <col class="field-name"/> | 
|  | <col class="field-body"/> | 
|  | <tbody valign="top"> | 
|  | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | 
|  | <li><strong>A</strong> (<a class="reference internal" href="ndarray.html#mxnet.ndarray.NDArray" title="mxnet.ndarray.NDArray"><em>NDArray</em></a>) – Tensor of lower triangular matrices</li> | 
|  | <li><strong>out</strong> (<em>NDArray, optional</em>) – The output NDArray to hold the result.</li> | 
|  | </ul> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>out</strong> – | 
|  | The output of this function.</p> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">NDArray or list of NDArrays</p> | 
|  | </td> | 
|  | </tr> | 
|  | </tbody> | 
|  | </table> | 
|  | </dd></dl> | 
|  | <dl class="function"> | 
|  | <dt id="mxnet.ndarray.linalg.sumlogdiag"> | 
|  | <code class="descclassname">mxnet.ndarray.linalg.</code><code class="descname">sumlogdiag</code><span class="sig-paren">(</span><em>A=None</em>, <em>out=None</em>, <em>name=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.ndarray.linalg.sumlogdiag" title="Permalink to this definition">¶</a></dt> | 
|  | <dd><p>Computes the sum of the logarithms of the diagonal elements of a square matrix. | 
|  | Input is a tensor <em>A</em> of dimension <em>n >= 2</em>.</p> | 
|  | <p>If <em>n=2</em>, <em>A</em> must be square with positive diagonal entries. We sum the natural | 
|  | logarithms of the diagonal elements, the result has shape (1,).</p> | 
|  | <p>If <em>n>2</em>, <em>sumlogdiag</em> is performed separately on the trailing two dimensions for all | 
|  | inputs (batch mode).</p> | 
|  | <div class="admonition note"> | 
|  | <p class="first admonition-title">Note</p> | 
|  | <p class="last">The operator supports float32 and float64 data types only.</p> | 
|  | </div> | 
|  | <p>Examples:</p> | 
|  | <div class="highlight-python"><div class="highlight"><pre><span></span>// Single matrix reduction | 
|  | A = [[1.0, 1.0], [1.0, 7.0]] | 
|  | sumlogdiag(A) = [1.9459] | 
|  |  | 
|  | // Batch matrix reduction | 
|  | A = [[[1.0, 1.0], [1.0, 7.0]], [[3.0, 0], [0, 17.0]]] | 
|  | sumlogdiag(A) = [1.9459, 3.9318] | 
|  | </pre></div> | 
|  | </div> | 
|  | <p>Defined in src/operator/tensor/la_op.cc:L404</p> | 
|  | <table class="docutils field-list" frame="void" rules="none"> | 
|  | <col class="field-name"/> | 
|  | <col class="field-body"/> | 
|  | <tbody valign="top"> | 
|  | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | 
|  | <li><strong>A</strong> (<a class="reference internal" href="ndarray.html#mxnet.ndarray.NDArray" title="mxnet.ndarray.NDArray"><em>NDArray</em></a>) – Tensor of square matrices</li> | 
|  | <li><strong>out</strong> (<em>NDArray, optional</em>) – The output NDArray to hold the result.</li> | 
|  | </ul> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>out</strong> – | 
|  | The output of this function.</p> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">NDArray or list of NDArrays</p> | 
|  | </td> | 
|  | </tr> | 
|  | </tbody> | 
|  | </table> | 
|  | </dd></dl> | 
|  | <dl class="function"> | 
|  | <dt id="mxnet.ndarray.linalg.syevd"> | 
|  | <code class="descclassname">mxnet.ndarray.linalg.</code><code class="descname">syevd</code><span class="sig-paren">(</span><em>A=None</em>, <em>out=None</em>, <em>name=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.ndarray.linalg.syevd" title="Permalink to this definition">¶</a></dt> | 
|  | <dd><p>Eigendecomposition for symmetric matrix. | 
|  | Input is a tensor <em>A</em> of dimension <em>n >= 2</em>.</p> | 
|  | <p>If <em>n=2</em>, <em>A</em> must be symmetric, of shape <em>(x, x)</em>. We compute the eigendecomposition, | 
|  | resulting in the orthonormal matrix <em>U</em> of eigenvectors, shape <em>(x, x)</em>, and the | 
|  | vector <em>L</em> of eigenvalues, shape <em>(x,)</em>, so that:</p> | 
|  | <blockquote> | 
|  | <div><em>U</em> * <em>A</em> = <em>diag(L)</em> * <em>U</em></div></blockquote> | 
|  | <p>Here:</p> | 
|  | <blockquote> | 
|  | <div><em>U</em> * <em>U</em><sup>T</sup> = <em>U</em><sup>T</sup> * <em>U</em> = <em>I</em></div></blockquote> | 
|  | <p>where <em>I</em> is the identity matrix. Also, <em>L(0) <= L(1) <= L(2) <= ...</em> (ascending order).</p> | 
|  | <p>If <em>n>2</em>, <em>syevd</em> is performed separately on the trailing two dimensions of <em>A</em> (batch | 
|  | mode). In this case, <em>U</em> has <em>n</em> dimensions like <em>A</em>, and <em>L</em> has <em>n-1</em> dimensions.</p> | 
|  | <div class="admonition note"> | 
|  | <p class="first admonition-title">Note</p> | 
|  | <p class="last">The operator supports float32 and float64 data types only.</p> | 
|  | </div> | 
|  | <div class="admonition note"> | 
|  | <p class="first admonition-title">Note</p> | 
|  | <p class="last">Derivatives for this operator are defined only if <em>A</em> is such that all its | 
|  | eigenvalues are distinct, and the eigengaps are not too small. If you need | 
|  | gradients, do not apply this operator to matrices with multiple eigenvalues.</p> | 
|  | </div> | 
|  | <p>Examples:</p> | 
|  | <div class="highlight-python"><div class="highlight"><pre><span></span>// Single symmetric eigendecomposition | 
|  | A = [[1., 2.], [2., 4.]] | 
|  | U, L = syevd(A) | 
|  | U = [[0.89442719, -0.4472136], | 
|  | [0.4472136, 0.89442719]] | 
|  | L = [0., 5.] | 
|  |  | 
|  | // Batch symmetric eigendecomposition | 
|  | A = [[[1., 2.], [2., 4.]], | 
|  | [[1., 2.], [2., 5.]]] | 
|  | U, L = syevd(A) | 
|  | U = [[[0.89442719, -0.4472136], | 
|  | [0.4472136, 0.89442719]], | 
|  | [[0.92387953, -0.38268343], | 
|  | [0.38268343, 0.92387953]]] | 
|  | L = [[0., 5.], | 
|  | [0.17157288, 5.82842712]] | 
|  | </pre></div> | 
|  | </div> | 
|  | <p>Defined in src/operator/tensor/la_op.cc:L597</p> | 
|  | <table class="docutils field-list" frame="void" rules="none"> | 
|  | <col class="field-name"/> | 
|  | <col class="field-body"/> | 
|  | <tbody valign="top"> | 
|  | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | 
|  | <li><strong>A</strong> (<a class="reference internal" href="ndarray.html#mxnet.ndarray.NDArray" title="mxnet.ndarray.NDArray"><em>NDArray</em></a>) – Tensor of input matrices to be factorized</li> | 
|  | <li><strong>out</strong> (<em>NDArray, optional</em>) – The output NDArray to hold the result.</li> | 
|  | </ul> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>out</strong> – | 
|  | The output of this function.</p> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">NDArray or list of NDArrays</p> | 
|  | </td> | 
|  | </tr> | 
|  | </tbody> | 
|  | </table> | 
|  | </dd></dl> | 
|  | <dl class="function"> | 
|  | <dt id="mxnet.ndarray.linalg.syrk"> | 
|  | <code class="descclassname">mxnet.ndarray.linalg.</code><code class="descname">syrk</code><span class="sig-paren">(</span><em>A=None</em>, <em>transpose=_Null</em>, <em>alpha=_Null</em>, <em>out=None</em>, <em>name=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.ndarray.linalg.syrk" title="Permalink to this definition">¶</a></dt> | 
|  | <dd><p>Multiplication of matrix with its transpose. | 
|  | Input is a tensor <em>A</em> of dimension <em>n >= 2</em>.</p> | 
|  | <p>If <em>n=2</em>, the operator performs the BLAS3 function <em>syrk</em>:</p> | 
|  | <blockquote> | 
|  | <div><em>out</em> = <em>alpha</em> * <em>A</em> * <em>A</em><sup>T</sup></div></blockquote> | 
|  | <p>if <em>transpose=False</em>, or</p> | 
|  | <blockquote> | 
|  | <div><em>out</em> = <em>alpha</em> * <em>A</em><sup>T</sup> * <em>A</em></div></blockquote> | 
|  | <p>if <em>transpose=True</em>.</p> | 
|  | <p>If <em>n>2</em>, <em>syrk</em> is performed separately on the trailing two dimensions for all | 
|  | inputs (batch mode).</p> | 
|  | <div class="admonition note"> | 
|  | <p class="first admonition-title">Note</p> | 
|  | <p class="last">The operator supports float32 and float64 data types only.</p> | 
|  | </div> | 
|  | <p>Examples:</p> | 
|  | <div class="highlight-python"><div class="highlight"><pre><span></span>// Single matrix multiply | 
|  | A = [[1., 2., 3.], [4., 5., 6.]] | 
|  | syrk(A, alpha=1., transpose=False) | 
|  | = [[14., 32.], | 
|  | [32., 77.]] | 
|  | syrk(A, alpha=1., transpose=True) | 
|  | = [[17., 22., 27.], | 
|  | [22., 29., 36.], | 
|  | [27., 36., 45.]] | 
|  |  | 
|  | // Batch matrix multiply | 
|  | A = [[[1., 1.]], [[0.1, 0.1]]] | 
|  | syrk(A, alpha=2., transpose=False) = [[[4.]], [[0.04]]] | 
|  | </pre></div> | 
|  | </div> | 
|  | <p>Defined in src/operator/tensor/la_op.cc:L460</p> | 
|  | <table class="docutils field-list" frame="void" rules="none"> | 
|  | <col class="field-name"/> | 
|  | <col class="field-body"/> | 
|  | <tbody valign="top"> | 
|  | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | 
|  | <li><strong>A</strong> (<a class="reference internal" href="ndarray.html#mxnet.ndarray.NDArray" title="mxnet.ndarray.NDArray"><em>NDArray</em></a>) – Tensor of input matrices</li> | 
|  | <li><strong>transpose</strong> (<em>boolean, optional, default=0</em>) – Use transpose of input matrix.</li> | 
|  | <li><strong>alpha</strong> (<em>double, optional, default=1</em>) – Scalar factor to be applied to the result.</li> | 
|  | <li><strong>out</strong> (<em>NDArray, optional</em>) – The output NDArray to hold the result.</li> | 
|  | </ul> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>out</strong> – | 
|  | The output of this function.</p> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">NDArray or list of NDArrays</p> | 
|  | </td> | 
|  | </tr> | 
|  | </tbody> | 
|  | </table> | 
|  | </dd></dl> | 
|  | <dl class="function"> | 
|  | <dt id="mxnet.ndarray.linalg.trmm"> | 
|  | <code class="descclassname">mxnet.ndarray.linalg.</code><code class="descname">trmm</code><span class="sig-paren">(</span><em>A=None</em>, <em>B=None</em>, <em>transpose=_Null</em>, <em>rightside=_Null</em>, <em>alpha=_Null</em>, <em>out=None</em>, <em>name=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.ndarray.linalg.trmm" title="Permalink to this definition">¶</a></dt> | 
|  | <dd><p>Performs multiplication with a lower triangular matrix. | 
|  | Input are tensors <em>A</em>, <em>B</em>, each of dimension <em>n >= 2</em> and having the same shape | 
|  | on the leading <em>n-2</em> dimensions.</p> | 
|  | <p>If <em>n=2</em>, <em>A</em> must be lower triangular. The operator performs the BLAS3 function | 
|  | <em>trmm</em>:</p> | 
|  | <blockquote> | 
|  | <div><em>out</em> = <em>alpha</em> * <em>op</em>(<em>A</em>) * <em>B</em></div></blockquote> | 
|  | <p>if <em>rightside=False</em>, or</p> | 
|  | <blockquote> | 
|  | <div><em>out</em> = <em>alpha</em> * <em>B</em> * <em>op</em>(<em>A</em>)</div></blockquote> | 
|  | <p>if <em>rightside=True</em>. Here, <em>alpha</em> is a scalar parameter, and <em>op()</em> is either the | 
|  | identity or the matrix transposition (depending on <em>transpose</em>).</p> | 
|  | <p>If <em>n>2</em>, <em>trmm</em> is performed separately on the trailing two dimensions for all inputs | 
|  | (batch mode).</p> | 
|  | <div class="admonition note"> | 
|  | <p class="first admonition-title">Note</p> | 
|  | <p class="last">The operator supports float32 and float64 data types only.</p> | 
|  | </div> | 
|  | <p>Examples:</p> | 
|  | <div class="highlight-python"><div class="highlight"><pre><span></span>// Single triangular matrix multiply | 
|  | A = [[1.0, 0], [1.0, 1.0]] | 
|  | B = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]] | 
|  | trmm(A, B, alpha=2.0) = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]] | 
|  |  | 
|  | // Batch triangular matrix multiply | 
|  | A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]] | 
|  | B = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5]]] | 
|  | trmm(A, B, alpha=2.0) = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]], | 
|  | [[1.0, 1.0, 1.0], [2.0, 2.0, 2.0]]] | 
|  | </pre></div> | 
|  | </div> | 
|  | <p>Defined in src/operator/tensor/la_op.cc:L292</p> | 
|  | <table class="docutils field-list" frame="void" rules="none"> | 
|  | <col class="field-name"/> | 
|  | <col class="field-body"/> | 
|  | <tbody valign="top"> | 
|  | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | 
|  | <li><strong>A</strong> (<a class="reference internal" href="ndarray.html#mxnet.ndarray.NDArray" title="mxnet.ndarray.NDArray"><em>NDArray</em></a>) – Tensor of lower triangular matrices</li> | 
|  | <li><strong>B</strong> (<a class="reference internal" href="ndarray.html#mxnet.ndarray.NDArray" title="mxnet.ndarray.NDArray"><em>NDArray</em></a>) – Tensor of matrices</li> | 
|  | <li><strong>transpose</strong> (<em>boolean, optional, default=0</em>) – Use transposed of the triangular matrix</li> | 
|  | <li><strong>rightside</strong> (<em>boolean, optional, default=0</em>) – Multiply triangular matrix from the right to non-triangular one.</li> | 
|  | <li><strong>alpha</strong> (<em>double, optional, default=1</em>) – Scalar factor to be applied to the result.</li> | 
|  | <li><strong>out</strong> (<em>NDArray, optional</em>) – The output NDArray to hold the result.</li> | 
|  | </ul> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>out</strong> – | 
|  | The output of this function.</p> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">NDArray or list of NDArrays</p> | 
|  | </td> | 
|  | </tr> | 
|  | </tbody> | 
|  | </table> | 
|  | </dd></dl> | 
|  | <dl class="function"> | 
|  | <dt id="mxnet.ndarray.linalg.trsm"> | 
|  | <code class="descclassname">mxnet.ndarray.linalg.</code><code class="descname">trsm</code><span class="sig-paren">(</span><em>A=None</em>, <em>B=None</em>, <em>transpose=_Null</em>, <em>rightside=_Null</em>, <em>alpha=_Null</em>, <em>out=None</em>, <em>name=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mxnet.ndarray.linalg.trsm" title="Permalink to this definition">¶</a></dt> | 
|  | <dd><p>Solves matrix equation involving a lower triangular matrix. | 
|  | Input are tensors <em>A</em>, <em>B</em>, each of dimension <em>n >= 2</em> and having the same shape | 
|  | on the leading <em>n-2</em> dimensions.</p> | 
|  | <p>If <em>n=2</em>, <em>A</em> must be lower triangular. The operator performs the BLAS3 function | 
|  | <em>trsm</em>, solving for <em>out</em> in:</p> | 
|  | <blockquote> | 
|  | <div><em>op</em>(<em>A</em>) * <em>out</em> = <em>alpha</em> * <em>B</em></div></blockquote> | 
|  | <p>if <em>rightside=False</em>, or</p> | 
|  | <blockquote> | 
|  | <div><em>out</em> * <em>op</em>(<em>A</em>) = <em>alpha</em> * <em>B</em></div></blockquote> | 
|  | <p>if <em>rightside=True</em>. Here, <em>alpha</em> is a scalar parameter, and <em>op()</em> is either the | 
|  | identity or the matrix transposition (depending on <em>transpose</em>).</p> | 
|  | <p>If <em>n>2</em>, <em>trsm</em> is performed separately on the trailing two dimensions for all inputs | 
|  | (batch mode).</p> | 
|  | <div class="admonition note"> | 
|  | <p class="first admonition-title">Note</p> | 
|  | <p class="last">The operator supports float32 and float64 data types only.</p> | 
|  | </div> | 
|  | <p>Examples:</p> | 
|  | <div class="highlight-python"><div class="highlight"><pre><span></span>// Single matrix solve | 
|  | A = [[1.0, 0], [1.0, 1.0]] | 
|  | B = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]] | 
|  | trsm(A, B, alpha=0.5) = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]] | 
|  |  | 
|  | // Batch matrix solve | 
|  | A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]] | 
|  | B = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]], | 
|  | [[4.0, 4.0, 4.0], [8.0, 8.0, 8.0]]] | 
|  | trsm(A, B, alpha=0.5) = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], | 
|  | [[2.0, 2.0, 2.0], [2.0, 2.0, 2.0]]] | 
|  | </pre></div> | 
|  | </div> | 
|  | <p>Defined in src/operator/tensor/la_op.cc:L355</p> | 
|  | <table class="docutils field-list" frame="void" rules="none"> | 
|  | <col class="field-name"/> | 
|  | <col class="field-body"/> | 
|  | <tbody valign="top"> | 
|  | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | 
|  | <li><strong>A</strong> (<a class="reference internal" href="ndarray.html#mxnet.ndarray.NDArray" title="mxnet.ndarray.NDArray"><em>NDArray</em></a>) – Tensor of lower triangular matrices</li> | 
|  | <li><strong>B</strong> (<a class="reference internal" href="ndarray.html#mxnet.ndarray.NDArray" title="mxnet.ndarray.NDArray"><em>NDArray</em></a>) – Tensor of matrices</li> | 
|  | <li><strong>transpose</strong> (<em>boolean, optional, default=0</em>) – Use transposed of the triangular matrix</li> | 
|  | <li><strong>rightside</strong> (<em>boolean, optional, default=0</em>) – Multiply triangular matrix from the right to non-triangular one.</li> | 
|  | <li><strong>alpha</strong> (<em>double, optional, default=1</em>) – Scalar factor to be applied to the result.</li> | 
|  | <li><strong>out</strong> (<em>NDArray, optional</em>) – The output NDArray to hold the result.</li> | 
|  | </ul> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>out</strong> – | 
|  | The output of this function.</p> | 
|  | </td> | 
|  | </tr> | 
|  | <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">NDArray or list of NDArrays</p> | 
|  | </td> | 
|  | </tr> | 
|  | </tbody> | 
|  | </table> | 
|  | </dd></dl> | 
|  | <script>auto_index("api-reference");</script></div> | 
|  | </div> | 
|  | </div> | 
|  | </div> | 
|  | <div aria-label="main navigation" class="sphinxsidebar rightsidebar" role="navigation"> | 
|  | <div class="sphinxsidebarwrapper"> | 
|  | <h3><a href="../../../index.html">Table Of Contents</a></h3> | 
|  | <ul> | 
|  | <li><a class="reference internal" href="#">Linear Algebra NDArray API</a><ul> | 
|  | <li><a class="reference internal" href="#overview">Overview</a></li> | 
|  | <li><a class="reference internal" href="#linear-algebra">Linear Algebra</a></li> | 
|  | <li><a class="reference internal" href="#api-reference">API Reference</a></li> | 
|  | </ul> | 
|  | </li> | 
|  | </ul> | 
|  | </div> | 
|  | </div> | 
|  | </div><div class="footer"> | 
|  | <div class="section-disclaimer"> | 
|  | <div class="container"> | 
|  | <div> | 
|  | <img height="60" src="https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/image/apache_incubator_logo.png"/> | 
|  | <p> | 
|  | Apache MXNet is an effort undergoing incubation at The Apache Software Foundation (ASF), <strong>sponsored by the <i>Apache Incubator</i></strong>. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF. | 
|  | </p> | 
|  | <p> | 
|  | "Copyright © 2017, The Apache Software Foundation | 
|  | Apache MXNet, MXNet, Apache, the Apache feather, and the Apache MXNet project logo are either registered trademarks or trademarks of the Apache Software Foundation." | 
|  | </p> | 
|  | </div> | 
|  | </div> | 
|  | </div> | 
|  | </div> <!-- pagename != index --> | 
|  | </div> | 
|  | <script crossorigin="anonymous" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> | 
|  | <script src="../../../_static/js/sidebar.js" type="text/javascript"></script> | 
|  | <script src="../../../_static/js/search.js" type="text/javascript"></script> | 
|  | <script src="../../../_static/js/navbar.js" type="text/javascript"></script> | 
|  | <script src="../../../_static/js/clipboard.min.js" type="text/javascript"></script> | 
|  | <script src="../../../_static/js/copycode.js" type="text/javascript"></script> | 
|  | <script src="../../../_static/js/page.js" type="text/javascript"></script> | 
|  | <script type="text/javascript"> | 
|  | $('body').ready(function () { | 
|  | $('body').css('visibility', 'visible'); | 
|  | }); | 
|  | </script> | 
|  | </body> | 
|  | </html> |