<?xml version="1.0" encoding="UTF-8"?>
<metanorma xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="3.5.0" schema-version="v2.2.0" flavor="generic">
<bibdata type="standard">
<title language="en" type="main">Open Neural Network Exchange (ONNX) — Part 2: Operator sets</title>

<title language="en" type="part">Operator sets</title>

<title language="en" type="title-part-prefix">Part 2</title>
<docidentifier primary="true" type="ONNX">ONNX 1-2 (unofficial draft)</docidentifier><docnumber>1</docnumber><date type="updated"><on>2026-09-20</on></date><contributor><role type="author"/><organization>
<name>ONNX Standardization Working Group</name>
<abbreviation>ONNX</abbreviation></organization></contributor><contributor><role type="author"><description>committee</description></role><organization>
<name>ONNX Standardization Working Group</name>
<subdivision type="Committee">
<name>ONNX Standardization Working Group</name>
</subdivision></organization></contributor><contributor><role type="publisher"/><organization>
<name>ONNX Standardization Working Group</name>
<abbreviation>ONNX</abbreviation></organization></contributor><edition>1</edition><version>2026-09-20</version><language>en</language><script>Latn</script><status><stage>preparatory</stage></status><copyright><from>2026</from><owner><organization>
<name>ONNX Standardization Working Group</name>
<abbreviation>ONNX</abbreviation></organization></owner></copyright><ext><doctype>standard</doctype><flavor>generic</flavor></ext></bibdata><metanorma-extension><semantic-metadata><stage-published>false</stage-published></semantic-metadata>
<presentation-metadata><toc-heading-levels>2</toc-heading-levels><html-toc-heading-levels>2</html-toc-heading-levels><doc-toc-heading-levels>2</doc-toc-heading-levels><pdf-toc-heading-levels>2</pdf-toc-heading-levels></presentation-metadata></metanorma-extension>
<preface><foreword id="_9df89f6a-f2c9-c5fb-02c5-07efb54904e7" obligation="informative">
<title id="_41c9fad3-d4c1-eecc-4fad-f91704acc026">Foreword</title>
<p id="_9706b36d-84b1-5428-296b-7abb126edc90">This document has been prepared by the ONNX Standardization Working Group.</p>

<p id="_04cd600a-c1bc-8e90-7689-c2234b6faa19">It is Part 2 of ONNX 1; Part 1 specifies the core and Part 3 the conformance test package.</p>

<admonition id="_7f660a40-bfef-b358-18c4-ed5f04f2f23d" type="important">
<name id="_cb720aab-8e9b-cfec-6013-35be85ccb8d9">Status of this document</name>
<p id="_cf856062-c4e9-92f4-bf82-f9ce730efe35">This is an <strong>unofficial</strong> working draft. It has no standing within the ONNX project, the Linux Foundation, IEC, ISO or any other standards development organization, and it MUST NOT be cited as a normative reference.</p>
</admonition></foreword><introduction id="_611aff81-a288-0d67-b19d-00713f61452f" obligation="informative">
<title id="_2b2e98d1-114a-3da4-8556-01ae0a724280">Introduction</title>
<p id="_a0f62e93-5aaa-f821-e8a0-d4f08444707c">This part carries the operator definitions. It is separate from Part 1 because the two move at different speeds: the core changes with the IR version, roughly once a year, while the operator sets change with every ONNX release, by hundreds of entries.</p>

<p id="_15b2874c-869b-eb1b-a7d6-09587b5f77db">Separating them means an operator added upstream amends this part and leaves Part 1 untouched: implementers do not re-read the core, and a citation of the core does not go stale because an operator was added.</p>

<p id="_9d5bacde-2a01-41ce-98f3-948147d3073f">The seam that makes this work is that Part 1 specifies the <strong>form</strong> an operator definition takes and the rules an operator set obeys, and names no operator. This part supplies the definitions in that form.</p>
</introduction></preface><sections>

<clause id="_de3c9568-cf7a-8d12-0537-dadf788bf880" type="scope" obligation="normative">
<title id="_f70b6ff6-6131-0e24-81e1-850dbe94b63d">Scope</title>
<p id="_a3d028d9-dbcc-574d-abe6-05f2076c2221">This document specifies the operator sets of the Open Neural Network Exchange (ONNX) format: the operators of each domain, at each operator set version, in the form required by  <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/>.</p>

<p id="_ddd615d9-3aef-57f9-f946-d011ccb85288">This document specifies:</p>

<ul id="_e27567a5-92ab-c876-f958-db67cb832f62"><li><p id="_fc4ddd0d-6779-255e-1eae-7fa480bfeaf0">the form an operator definition takes;</p>
</li>
<li><p id="_6a1dc23c-ea01-7ede-e1a6-da948c66d066">the operators of the default domain;</p>
</li>
<li><p id="_8d97ce7e-18d2-eb24-33f9-6a85f54ff596">the operators of the <tt>ai.onnx.ml</tt> domain;</p>
</li>
<li><p id="_e77b2fda-0066-6264-8c16-a2b2067cc174">for each operator, its signature, attributes, type constraints, shape inference, semantics and error conditions.</p>
</li>
</ul>

<p id="_ed8f3358-3cbd-ad51-f68b-a1abfd88d1f6">This document does not specify:</p>

<ul id="_b6676247-4100-bf92-4b61-62aa3b911f96"><li><p id="_94c8f3ca-560c-0723-61af-b78e1474c439">the information model, type system, evaluation semantics, validation rules, numerical obligations, encoding or versioning rules, which are in <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/>;</p>
</li>
<li><p id="_87856365-99f5-6428-1f25-fedace7a1d3f">the conformance test vectors, which are in <eref type="inline" bibitemid="onnx-part-3" citeas="ONNX 1-3"/>.</p>
</li>
</ul>
</clause>



<terms id="_adff3f6e-41be-2aa1-4807-70c3901d771b" obligation="normative">
<title id="_dfb2eab2-f980-6365-3c47-81d0eb272962">Terms and definitions</title><p id="_9608c37a-eaae-1098-3a4b-f705fd512d85">No terms and definitions are listed in this document.</p>
<p id="_ea27ae6f-5f87-148f-3f63-cf22ba1e35bd">The terms and definitions given in <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/> apply.</p>

<note id="_f3dd357a-4965-0be6-adaa-a9cce17c6a38"><p id="_6714b3a3-fdac-b1bf-5e8e-ce0334cdda97">In particular <strong>operator</strong>, <strong>domain</strong>, <strong>operator set</strong>, <strong>attribute</strong>, <strong>tensor</strong>, <strong>element type</strong> and <strong>shape</strong> are defined in Clause 3 of <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/> and are not restated here.</p>
</note>
</terms>

<clause id="_2b300add-cab7-26dd-4307-a52558bc9cc0" anchor="required-form" obligation="normative">
<title id="_3c1565bb-8103-1e4b-15a3-21181b0caea1">Required form of an operator specification</title>
<clause id="_9f2829d2-7175-74f0-7eaa-6c9cdc319b68" obligation="normative">
<title id="_53d82e48-1024-e16a-9901-40ceda1ab9b0">General</title>
<p id="_8451e33c-012a-9241-a60f-f662502c2909">Every operator specified by this document SHALL be specified in the form given in  <xref target="tbl-operator-template" style="short"/>.</p>

<p id="_601ed71e-a6e2-1c32-4c8a-832ac43ad5c5">The form is normative. An operator definition that omits a mandatory element is not a definition for the purposes of  <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/>, and an implementation cannot be required to support it.</p>

<table id="_4acf7a1b-667e-49d1-3413-81bb0dad1665" anchor="tbl-operator-template">
<name id="_d0c136f7-f13b-6d5c-9216-c244cb50b602">Required elements of an operator specification</name>
<thead><tr id="_9a13f631-51c2-da31-a350-2e0ec5c17437"><th id="_cf2e3ab6-07f6-9a9d-d73e-305dacc6c31a" valign="top" align="left">Element</th>
<th id="_786a0ae1-226d-825f-e7bc-1560bee6a734" valign="top" align="left">Obligation</th>
<th id="_9a5b2dc2-0acf-5edc-2596-8a229bfb6ff3" valign="top" align="left">Content</th>
</tr></thead>
<tbody><tr id="_c7a43619-b918-863f-48ae-1209a1528e6d"><td id="_57f75cbe-2e8b-c9a1-662d-a9605e97097a" valign="top" align="left">Name and domain</td>
<td id="_93a84538-7cb7-8563-45a0-82fb97cd254b" valign="top" align="left">mandatory</td>
<td id="_11fef195-8b26-8aa6-40a5-12d439674da1" valign="top" align="left">Identifier of the operator.</td>
</tr><tr id="_7f29c9da-71a8-25b2-5df1-25560654852b"><td id="_20cd8673-a3df-1d89-5175-69520dea6e45" valign="top" align="left">Since version</td>
<td id="_9c627228-249f-ed3f-f46a-c5b6cbfec6d6" valign="top" align="left">mandatory</td>
<td id="_08b57d2f-bf53-025c-c215-9972382d1751" valign="top" align="left">Operator set version in which this definition took effect.</td>
</tr><tr id="_6cbe0103-a3f5-a08f-48cc-d1831ddd7205"><td id="_28e3e0b2-4f42-0e7e-0878-2669e369be2d" valign="top" align="left">Inputs</td>
<td id="_6bfdc0b4-c081-dc53-d9a5-06c1a1611bce" valign="top" align="left">mandatory</td>
<td id="_e09baa3a-cc86-a01e-2e4f-181581ccb7bd" valign="top" align="left">Name, type constraint, and optionality of each formal input.</td>
</tr><tr id="_8efd1686-649c-6e72-242a-08dee908c71e"><td id="_92752dc8-6a1c-98f1-b149-76db0722da27" valign="top" align="left">Outputs</td>
<td id="_a73c03b7-f4d2-a517-9d03-f37bfbbfe2c4" valign="top" align="left">mandatory</td>
<td id="_5c8a93cc-1dea-68dc-510d-943d8edb20c5" valign="top" align="left">Name and type constraint of each formal output.</td>
</tr><tr id="_49829450-e585-e7d9-549a-36168e65b15f"><td id="_8d3d5fe7-ddb8-e8dd-4b6d-ac10ebd12669" valign="top" align="left">Attributes</td>
<td id="_18f487e3-9b24-7a93-3657-ae85792dafd9" valign="top" align="left">mandatory</td>
<td id="_acbef598-de09-c979-b849-7b9d999dca55" valign="top" align="left">Name, type, default value, and obligation of each attribute.</td>
</tr><tr id="_00b219b1-b4ea-ee94-6e7a-fa23f1d6068f"><td id="_fcfaa6a6-4f56-9b10-2a30-ef9ac3cd1235" valign="top" align="left">Type constraints</td>
<td id="_f93c0064-c78b-d6c5-a57a-b95b8b14cf4f" valign="top" align="left">mandatory</td>
<td id="_0c135b39-7bf6-b3e9-3e40-428974be4a4d" valign="top" align="left">Named sets of admissible element types.</td>
</tr><tr id="_bb00aecc-d727-4863-b8a7-40d99c40fa75"><td id="_8048f996-71d6-0f4c-581e-ddcbbf472bde" valign="top" align="left">Shape inference</td>
<td id="_b2464179-55de-e795-2526-d712af418f93" valign="top" align="left">mandatory</td>
<td id="_e4c8d641-0a51-3526-68ba-72ade9a41c56" valign="top" align="left">The output shape as a function of input shapes and attributes.</td>
</tr><tr id="_b88fd57c-9800-a7bc-6969-c2b74e26efe9"><td id="_719736d9-91e3-eea8-ca08-d471289f3c73" valign="top" align="left">Semantics</td>
<td id="_1c6f116b-e69a-348f-c704-1e80272a92ab" valign="top" align="left">mandatory</td>
<td id="_6dd48c46-ca76-37f0-eca5-256c0b8d0192" valign="top" align="left">The value of each output as a function of the inputs.</td>
</tr><tr id="_005cc23d-215f-debd-00f8-fb0011a0cfda"><td id="_21a3a51c-54ba-df6c-bc5e-5fe6650bd2b9" valign="top" align="left">Determinism</td>
<td id="_da24e90f-a2e0-1e6a-9eb9-994e2b331636" valign="top" align="left">conditional</td>
<td id="_69ee63ad-fbeb-96eb-48d5-d72c39ef3b58" valign="top" align="left">Required if the operator is not deterministic; see Clause 11 of <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/>.</td>
</tr><tr id="_c9544b7e-a1e0-a145-e348-e53b8e661bba"><td id="_4d157e9e-1a11-2bf1-ec29-0ffe2365db8e" valign="top" align="left">Errors</td>
<td id="_9bcffa74-f22b-dc5e-226f-b0e5e8ed0bec" valign="top" align="left">mandatory</td>
<td id="_51d4c93f-dba9-b71c-ae4a-b196658bd41d" valign="top" align="left">The conditions under which the operator is not defined.</td>
</tr><tr id="_90e6ebb4-2913-3ef2-2dec-f2ec8297401e"><td id="_9c398966-26e5-2aa7-3ad6-cb03d007eec8" valign="top" align="left">Test vectors</td>
<td id="_732f3b30-e2e9-8d4c-8615-e8431a663258" valign="top" align="left">mandatory</td>
<td id="_603cc776-e9a0-c099-3847-fd40781b75f8" valign="top" align="left">Reference to the vectors in <eref type="inline" bibitemid="onnx-part-3" citeas="ONNX 1-3"/> that check this operator.</td>
</tr><tr id="_7fa3b184-b764-d438-fbbe-b6d31677af9c"><td id="_5a3ab62f-3b01-bf6f-a65a-26f9f4ab05e9" valign="top" align="left">Examples</td>
<td id="_467b8085-2b5a-3ebd-7787-54ada3b1c545" valign="top" align="left">optional</td>
<td id="_8c97d9eb-704b-4eee-e8a9-afdd34bddec2" valign="top" align="left">Informative.</td>
</tr></tbody>
<note id="_aa4ac83b-f0df-3450-8ed2-0fda9208ed53"><p id="_593c2b1e-8060-87cb-0996-b118248528ed">The present ONNX operator documentation supplies most of these elements for most operators, but not all of them for all operators. Annex C of <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/> records the gaps.</p>
</note></table>


</clause>

<clause id="_59b81421-f692-0b1e-deb0-64b1662e3503" obligation="normative">
<title id="_4a7bc6b4-1e59-8f75-d200-d8cb4e945e6f">Worked example of the required form</title>
<p id="_ce647c9f-6304-ef08-b0a3-38fec52bab25">The following illustrates the required form. It is normative as to <strong>form</strong>; the semantics given are those of the operator as currently defined.</p>

<example id="_3afa918d-de28-0a41-ea36-f72bec1734c8">
<name id="_b086f716-f370-7d51-681f-b3628eb9a71d"><tt>Relu</tt> (default domain)</name>
<dl id="_be67285c-941c-7a30-e97b-8afa49a22568"><dt>Since version</dt>
<dd id="_3e3d3be4-aa71-5999-cbd7-98f317dc3db1"><p id="_5dd7e977-6d4a-ebb3-982c-a1e3b0a2331e">14</p>
</dd>
<dt>Inputs</dt>
<dd id="_a1616027-f8bd-be8e-1ddb-b5be86d2e069"><p id="_3c72b18b-14e0-d31d-d92c-23fbb1934141"><tt>X</tt> (type constraint <tt>T</tt>), required.</p>
</dd>
<dt>Outputs</dt>
<dd id="_c6fd4630-2160-a3d4-0985-a88aec7495ad"><p id="_fa620f1c-c14e-1437-3d32-1e2753060846"><tt>Y</tt> (type constraint <tt>T</tt>).</p>
</dd>
<dt>Attributes</dt>
<dd id="_d80b1ecb-a22b-3610-f0f7-f12ed57059ae"><p id="_e4a23416-bc47-c36a-06c6-cba107766c3a">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_e28faf0c-8b66-2b45-5722-0045763694ac"><p id="_adc57b28-1591-44b1-5022-9ec7ea41318d"><tt>T</tt> : <tt>FLOAT</tt>, <tt>DOUBLE</tt>, <tt>FLOAT16</tt>, <tt>BFLOAT16</tt>, <tt>INT8</tt>, <tt>INT16</tt>, <tt>INT32</tt>, <tt>INT64</tt>.</p>
</dd>
<dt>Shape inference</dt>
<dd id="_8919a565-2abc-c47e-72d3-90c9d99976e6"><p id="_51043912-a177-05bd-31fe-c015e4cd70c3">The shape of <tt>Y</tt> equals the shape of <tt>X</tt>.</p>
</dd>
<dt>Semantics</dt>
<dd id="_f3d0245d-88ec-8680-7b1f-a2d9c1e8ae60"><p id="_c9cfb0a7-82b9-20d6-0362-b5a07a71ba6d">For every index <stem block="false" type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML">
  <mstyle displaystyle="false">
    <mi>i</mi>
  </mstyle>
</math><asciimath>i</asciimath></stem> into <tt>X</tt>,
<stem block="false" type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML">
  <mstyle displaystyle="false">
    <msub>
      <mi>Y</mi>
      <mi>i</mi>
    </msub>
    <mo>=</mo>
    <mrow>
      <mo rspace="thickmathspace"/>
      <mrow>
        <mi>max</mi>
        <mrow>
          <mo>(</mo>
          <msub>
            <mi>X</mi>
            <mi>i</mi>
          </msub>
          <mo>,</mo>
          <mn>0</mn>
          <mo>)</mo>
        </mrow>
      </mrow>
    </mrow>
  </mstyle>
</math><asciimath>Y_i = max(X_i, 0)</asciimath></stem>.</p>
</dd>
<dt>Determinism</dt>
<dd id="_81a9b40f-d89d-9f3f-2967-89b0fdd58d6e"><p id="_478606f8-aee3-355b-e451-55f1dc0bc220">Deterministic.</p>
</dd>
<dt>Errors</dt>
<dd id="_bf569dbe-20bb-aa7c-6c22-67095ceec802"><p id="_c9b71857-a399-fd0d-0978-0ed3190d6f31">None. For floating-point element types, the result for a NaN input is
<stem block="false" type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML">
  <mstyle displaystyle="false">
    <mi>N</mi>
    <mi>a</mi>
    <mi>N</mi>
  </mstyle>
</math><asciimath>NaN</asciimath></stem>.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_ba92dde1-3d0e-8f94-89a3-98c7128d49f1"><p id="_7a3693a6-80f2-a901-3430-6b001b861239"><tt>ai.onnx/Relu/14</tt> in <eref type="inline" bibitemid="onnx-part-3" citeas="ONNX 1-3"/>.</p>
</dd>
</dl>
</example>

<admonition id="_7c094d50-a05a-b5fa-2493-fcfbe0266006" type="important">
<name id="_100d3c06-3514-138d-dd50-34f351f21998">Editorial note</name>
<p id="_52dbf77f-4794-ce63-7b6d-26c02273c7b0">Confirm the NaN behaviour of the example above against the reference
implementation before the committee draft. <stem block="false" type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML">
  <mstyle displaystyle="false">
    <mrow>
      <mo rspace="thickmathspace"/>
      <mrow>
        <mi>max</mi>
        <mrow>
          <mo>(</mo>
          <mi>N</mi>
          <mi>a</mi>
          <mi>N</mi>
          <mo>,</mo>
          <mn>0</mn>
          <mo>)</mo>
        </mrow>
      </mrow>
    </mrow>
  </mstyle>
</math><asciimath>max(NaN, 0)</asciimath></stem> is not well defined by  <eref type="inline" bibitemid="ieee754" citeas="IEEE 754-2019"/> without stating which of <tt>maxNum</tt> or <tt>maximum</tt> is intended, and Clause 11 of  <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/> owes that decision once for all operators rather than per definition.</p>
</admonition></clause>

<clause id="_e9bf398e-2373-0d3a-7216-d8cc5b05dc23" obligation="normative">
<title id="_1629fe0f-9821-91a0-f55a-9583272cb0b9">Operator set versions</title>
<p id="_d9ce206c-6192-9bda-6b05-66cd440e5ddb">Each clause below specifies one domain. Within a domain, an operator definition is identified by its name together with the operator set version in which it took effect.</p>

<p id="_a676b64d-1856-5774-f16a-6f93bb224274">The evolution rules an operator set obeys are in Clause 14 of <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/>.</p>
</clause>
</clause>

<clause id="_0385589c-14a9-4411-f892-89eb46d1dd0c" obligation="normative">
<title id="_e23bc331-d8c9-ff32-1055-d7bee5e894ac">The default domain</title>
<clause id="_1663017d-79b5-1441-e807-751109a6c160" obligation="normative">
<title id="_0175f76d-716b-304d-d5e0-55b2c2c71130">General</title>
<p id="_b2bc970d-9684-bb14-0ffd-93a630df0dda">This clause specifies the operators of the <tt>ai.onnx</tt> domain, in the form required by  <xref target="required-form" style="short"/>.</p>

<admonition id="_eb044da9-35d4-3a9c-2162-aaba93ed87ee" type="important">
<name id="_05c66f25-3457-c5c4-49cc-da79e8152bff">Editorial note</name>
<p id="_3e496b03-ef2c-4a4c-eb26-1f89f9a50f82">This clause is generated from the upstream operator documentation, which does not supply three of the elements  <xref target="required-form" style="short"/> makes mandatory: shape inference, determinism and error conditions. Every operator below records their absence rather than omitting the elements, so that the incompleteness is visible where it matters instead of only in Annex C of <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/>.</p>

<p id="_c97ef0ff-72dc-c4cf-fb4f-37b8ebb3802e">Supplying them is the substance of the work this part represents. They cannot be generated, because the upstream source does not contain them; they have to be written, per operator, and agreed.</p>

<p id="_b3fa632f-9433-af88-37a8-2cf6d5e3b574">Operator prose below also refers to upstream documents that <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/> does not yet restate, broadcasting among them. Those references appear as plain text, because a normative cross-reference to a clause that does not exist would be worse than none. Annex C of <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/> records the omission.</p>
</admonition>
<note id="_78cb97da-5297-6869-e70c-ba004912bb44"><p id="_e60cc15e-1940-3983-86e8-1683ece8a9bf">Examples and sample implementations are not reproduced. They are informative under  <xref target="required-form" style="short"/>, and the reference implementation is not restated here; see Annex D of  <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/>. The test vector names extracted from the examples are retained, because  <eref type="inline" bibitemid="onnx-part-3" citeas="ONNX 1-3"/> needs them.</p>
</note>
</clause>

<clause id="_d258a23d-060f-8a76-fdcd-29883a81a816" anchor="op-ai-onnx-default-abs" obligation="normative">
<title id="_41ac5799-8d03-7778-03a8-0f0655de238e">Abs</title>
<p id="_c492a3ae-b9a5-75c8-c80d-fca017eb95b1">Absolute takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where absolute value, y = abs(x), is applied to the tensor elementwise.</p>

<dl id="_0ad9437e-198a-2776-82c5-99dd67c63fbe"><dt>Domain</dt>
<dd id="_f78f60b5-8957-b7fa-c357-770e18a464eb"><p id="_383bb864-4725-c7b3-b149-0576c3ee03de"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_e2e73c56-7151-a952-a8c8-c3ea027d1618"><p id="_236a460a-b156-4198-6744-9b750b3d0cbe">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_09f18132-ef2f-9a9e-b5f1-b053f8cc8701"><p id="_6bb2a550-9287-1521-4f65-5f25d3c6509d">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_a6a3a5aa-2f08-7d69-5edd-aafbb000ae08"><p id="_7e17b0de-b948-3659-1bda-279d2b4ad915"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_df9562f0-b2f5-6bde-f11e-8b6295722c2c"><p id="_dfed5704-1718-0745-ccb2-9981d3d0b85f"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_084a7308-64b1-256b-8360-f8dbe883e5f4"><p id="_fae82b58-0606-f06c-3f88-34da3c86360b">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_3a0e532c-a149-2be2-d782-d882401006db"><p id="_47c8c6f0-0d9f-e576-1ad8-8ede5806ab34"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to all numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_1d58f4d1-d57d-8e6b-d0ec-228a638ff219"><p id="_47d782c7-5629-52ef-9544-b82722599f93"><tt>test_abs</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_7f725044-0bd3-fc6f-be0a-e372e0de2eea"><p id="_70c46014-c929-c64f-5a0d-86410dc9188c">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_452a753d-6195-22dc-ad0e-f748d0d18e6f" anchor="op-ai-onnx-default-acos" obligation="normative">
<title id="_79ac3b96-8040-2799-4367-a9ffb1fb7801">Acos</title>
<p id="_90c8926a-aa75-082e-8413-068efb1e859c">Calculates the arccosine (inverse of cosine) of the given input tensor, element-wise.</p>

<dl id="_5937acd1-1a71-7394-7555-d56a8eee7eb9"><dt>Domain</dt>
<dd id="_23fee25b-cdc6-6e0e-13a0-508131484bbe"><p id="_8f5fea28-1a5c-d6c7-e742-171dec5d4767"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_e3bd1747-1013-5771-ed36-f68def729d65"><p id="_1aa28c22-8025-cd57-1cab-f4459d6e8c62">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_e9645dbf-b915-c831-4a12-8ec8df3c6324"><p id="_13a90bff-6781-0425-9542-4ca01124396d">7</p>
</dd>
<dt>Inputs</dt>
<dd id="_9033c989-9792-1d62-ceb7-af8cc4fd1961"><p id="_c1235367-5777-92af-319b-ce5ba454b16a"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_f2ea2060-25bc-0d74-bf6c-fb0b8dacfd59"><p id="_81ed1031-1438-1417-5cc8-ab59a7479671"><tt>output (differentiable) : T</tt> — The arccosine of the input tensor computed element-wise</p>
</dd>
<dt>Attributes</dt>
<dd id="_55b55c12-4f6c-48da-a7ce-708f0047bab7"><p id="_365f73a6-d5d7-a1a2-1edc-7e09626d4272">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_b143913f-0b49-7aa3-e161-53ef2faba8a6"><p id="_08399e56-29d3-b280-98c9-a4cbe3e2525f"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_60c4183a-028e-c4d0-a25c-0deb926a6b13"><p id="_bd6f4128-1c0a-bb1b-2a49-f5ab2369ddf0"><tt>test_acos_example</tt>, <tt>test_acos</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_1d852367-9a24-4e1a-70ef-2ce8ab6666b4"><p id="_ef71a057-5d17-e14f-6157-fa0e76876c90">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_56e9a6cc-38a9-3503-ed3f-059cbfb5a0e0" anchor="op-ai-onnx-default-acosh" obligation="normative">
<title id="_4632cbed-1e38-8c09-babe-74317071abd7">Acosh</title>
<p id="_2054b83e-3885-1552-b4d2-512304d86636">Calculates the hyperbolic arccosine of the given input tensor element-wise.</p>

<dl id="_e89f9737-aec2-91e7-bf0d-05c44fb81f9e"><dt>Domain</dt>
<dd id="_2999673f-6aab-c839-4b31-3d6c7f1f4e7a"><p id="_5f35ec07-eefd-2e98-5fda-636fd4cdedcd"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_aed7bfb9-0b58-4dfd-49ed-b612113a588a"><p id="_f5eab4f8-f29f-71f0-a3ca-64816a856c6b">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_d42d4ae0-71f2-bfa8-abef-e328d2cb3d53"><p id="_a8523e16-5e7c-d1e4-9d03-11c9ea0a373f">9</p>
</dd>
<dt>Inputs</dt>
<dd id="_adb158ee-783b-c0a7-f761-ceaa31da084a"><p id="_db31fa25-3d88-192e-5261-6eb664ae2e46"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_058cd48f-0531-1089-35b6-a04f5d9ec9bd"><p id="_fc8ef54b-5a46-16dc-ab9c-0d768366c960"><tt>output (differentiable) : T</tt> — The hyperbolic arccosine values of the input tensor computed element-wise</p>
</dd>
<dt>Attributes</dt>
<dd id="_de093343-0074-7294-8803-df3fae2f107a"><p id="_b33a0cf4-4b52-3c7e-96f7-94787eb11aef">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_9667507f-c5d5-7cb9-aa59-75dcc25d6ffd"><p id="_ca97ee7e-c087-92bc-103c-086ed68aa5e0"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_6121cd26-4e8e-3bc4-3711-0e1742b2cd4d"><p id="_13474cb6-4bd2-798e-26f3-06d6fb783c27"><tt>test_acosh_example</tt>, <tt>test_acosh</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_7d797def-fc2b-b6d4-18e0-3be6c7d756e9"><p id="_02e4528e-7bd0-94bb-ea27-4a2350308a98">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_3c02664e-a740-3c6e-d126-f10d6290f8d4" anchor="op-ai-onnx-default-add" obligation="normative">
<title id="_d5e21820-18e6-cd40-61ea-aba2c03bf153">Add</title>
<p id="_e84b4da1-d290-9b5b-d898-d8401ae06f8c">Performs element-wise binary addition (with Numpy-style broadcasting support).</p>

<p id="_134f6e12-eebb-23e9-2df1-e35a6331ee6b">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<p id="_61fdc983-ccd6-d09e-12e5-31c4412c060e">(Opset 14 change): Extend supported types to include uint8, int8, uint16, and int16.</p>

<dl id="_9dd2f0fc-fad9-955c-23e7-48582f461fb9"><dt>Domain</dt>
<dd id="_f3e7a8ee-2e7e-0651-cf30-d9d011800669"><p id="_51e8ae35-a516-2376-1d7d-068cc519a06b"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_5a1af3cf-de54-a5ce-e483-74e23fbb80e7"><p id="_885932a2-2473-b218-2d42-8c7f4e9e0406">14</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_b9cbecf4-f260-557a-87d8-e28057b6c84a"><p id="_40077790-7f9f-8a41-2fc2-47515e64105e">1, 6, 7, 13</p>
</dd>
<dt>Inputs</dt>
<dd id="_7201371d-14d8-e95c-8d0a-f4b2d3175fc3"><p id="_0168bbae-372c-2244-c704-ba1c18f17651"><tt>A (differentiable) : T</tt> — First operand.<br/> <tt>B (differentiable) : T</tt> — Second operand.</p>
</dd>
<dt>Outputs</dt>
<dd id="_cf7d2496-43ee-c452-31f4-10ee15f32a21"><p id="_9a8a11ee-c461-1f61-baf9-f0cf52f11528"><tt>C (differentiable) : T</tt> — Result, has same element type as two inputs</p>
</dd>
<dt>Attributes</dt>
<dd id="_4bcc46fc-e831-f249-d3cc-d7399976f3b5"><p id="_1ec3efd8-f15c-c8d5-10de-8cd3922b5acc">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_f9fbd215-a5f4-e6fa-5659-ae81391f36b7"><p id="_30d7dcd5-d3d1-2541-89e8-ebdc65af0fd0"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to all numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_afb5824d-929a-39bc-2667-13fdd6ff528f"><p id="_22378681-18c2-a94f-65a9-815314a707aa"><tt>test_add</tt>, <tt>test_add_int8</tt>, <tt>test_add_int16</tt>, <tt>test_add_uint8</tt>, <tt>test_add_uint16</tt>, <tt>test_add_uint32</tt>, <tt>test_add_uint64</tt>, <tt>test_add_bcast</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_6f644edf-9e9c-0175-95e2-32f49af2fa5c"><p id="_47f45c36-06f4-54bd-37bb-894e52189a2e">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_249c68f0-5bc4-5a73-bbd9-a2641957cfa0" anchor="op-ai-onnx-default-affinegrid" obligation="normative">
<title id="_605a0bb8-9040-c9db-58c4-305adbfe3298">AffineGrid</title>
<p id="_f742bf4b-ac08-7676-7a7f-4d2a50d30d3d">Generates a 2D or 3D flow field (sampling grid), given a batch of affine matrices theta (<link target="https://pytorch.org/docs/stable/generated/torch.nn.functional.affine_grid.html"/>). An affine matrix  <tt>theta</tt> is applied to a position tensor represented in its homogeneous expression. Here is an example in 3D:</p>

<sourcecode id="_a84b817e-1b56-6385-28f2-a3ce686cf4b4" unnumbered="true"><body>[r00, r01, r02, t0]   [x]   [x']
[r10, r11, r12, t1] * [y] = [y']
[r20, r21, r22, t2]   [z]   [z']
[0,   0,   0,   1 ]   [1]   [1 ]</body></sourcecode>


<p id="_0bffd4c6-51ea-bb48-7b45-c2dba538378d">where <tt>(x, y, z)</tt> is the position in the original space, <tt>(x', y', z')</tt> is the position in the output space. The last row is always  <tt>[0, 0, 0, 1]</tt> and is not stored in the affine matrix. Therefore we have <tt>theta</tt> of shape <tt>(N, 2, 3)</tt> for 2D or <tt>(N, 3, 4)</tt> for 3D.</p>

<p id="_c7c272ce-4f0b-762d-b24c-77f30b45caf1">Input <tt>size</tt> is used to define grid of positions evenly spaced in the original 2D or 3D space, with dimensions ranging from <tt>-1</tt> to <tt>1</tt>. The output  <tt>grid</tt> contains positions in the output space.</p>

<p id="_2e78f85c-b0aa-f761-65dc-62633a8e77dd">When <tt>align_corners=1</tt>, consider <tt>-1</tt> and <tt>1</tt> to refer to the centers of the corner pixels (mark <tt>v</tt> in illustration).</p>

<sourcecode id="_5fb7f3ef-9cb0-3b96-2765-f62b4f72b29f" unnumbered="true"><body>v            v            v            v
|-------------------|------------------|
-1                  0                  1</body></sourcecode>


<p id="_14e009f2-d210-8b77-686a-dc6763aaadcd">When <tt>align_corners=0</tt>, consider <tt>-1</tt> and <tt>1</tt> to refer to the outer edge of the corner pixels.</p>

<sourcecode id="_34277438-005b-a928-faaa-903e88ecc85d" unnumbered="true"><body>    v        v         v         v
|------------------|-------------------|
-1                 0                   1</body></sourcecode>


<dl id="_2d0b98ba-a3a8-9f22-2c05-aff7cead8324"><dt>Domain</dt>
<dd id="_4039cd0d-38e5-839a-be27-e939247240c4"><p id="_8e3573de-6f61-6bb6-7b9f-cc0595f06903"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_93dad69d-f7c0-b3d8-1854-33ac7a22a78e"><p id="_accda878-f902-8516-4e10-90616528cecb">20</p>
</dd>
<dt>Inputs</dt>
<dd id="_022057dc-7e6f-2fb3-9319-9be7b96fa510"><p id="_de649285-0606-a79a-a169-b43d9a0206a6"><tt>theta (non-differentiable) : T1</tt> — input batch of affine matrices with shape (N, 2, 3) for 2D or (N, 3, 4) for 3D<br/> <tt>size (non-differentiable) : T2</tt> — the target output image size (N, C, H, W) for 2D or (N, C, D, H, W) for 3D</p>
</dd>
<dt>Outputs</dt>
<dd id="_3c747be4-4615-0ede-72c7-52b1222d01a0"><p id="_80cc2c65-dfe2-bb21-1db7-28f7472c2f5d"><tt>grid (differentiable) : T1</tt> — output tensor of shape (N, H, W, 2) of 2D sample coordinates or (N, D, H, W, 3) of 3D sample coordinates.</p>
</dd>
<dt>Attributes</dt>
<dd id="_8d926529-cf6c-44e8-0e02-99bd57d48056"><p id="_15cfd12b-e5de-606d-8844-80ec2b58da9f"><tt>align_corners : int (default is 0)</tt> — if align_corners=1, consider -1 and 1 to refer to the centers of the corner pixels. if align_corners=0, consider -1 and 1 to refer to the outer edge the corner pixels.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_22a073ec-4d07-e43a-e001-fac8a8ea3498"><p id="_efe96333-c4d1-1577-5d8d-11348015acc0"><tt>T1 : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain grid types to float tensors.<br/> <tt>T2 : tensor(int64)</tt> — Constrain size’s type to int64 tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_4cb9545d-afb2-a84e-5a8f-471c606bb115"><p id="_ae994d88-b9ab-2c35-cdb2-3922cd82a713">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_2d66dda8-11b7-f4ad-ae62-17f0c4f9a8ff"><p id="_edf43cce-3d53-a60d-ef79-746bee0df6f6">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_fe163441-4762-f590-6f75-bb2afb6bbaf0" anchor="op-ai-onnx-default-and" obligation="normative">
<title id="_b2de5fff-f47c-9bdb-af26-473d9f105d4b">And</title>
<p id="_e2a89557-a689-5faa-0805-210b0a3e8f47">Returns the tensor resulted from performing the <tt>and</tt> logical operation elementwise on the input tensors  <tt>A</tt> and <tt>B</tt> (with Numpy-style broadcasting support).</p>

<p id="_e1e00961-d51f-2e52-4876-d91085d0b624">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_efd7beb9-6cb7-fdcb-c418-796d8c61aee9"><dt>Domain</dt>
<dd id="_239b7ddb-19af-6e39-23b2-a39ed7859163"><p id="_4e3accd6-a1c0-0979-9e02-82e59f251e98"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_6048f53d-cbe5-f9e7-6e7a-20baf906f1fb"><p id="_4d3bf9c3-97c7-2ba5-8b40-3be04fbb79f3">7</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_6014c7fd-2841-83b2-f8b5-a1909a4291b9"><p id="_cd523bd3-aacc-e80b-a597-3a72469bcf4d">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_33bc263b-d235-b9a3-3828-740f36622903"><p id="_dd658faf-a470-49c3-9fb1-fdd9a08abc43"><tt>A (non-differentiable) : T</tt> — First input operand for the logical operator.<br/> <tt>B (non-differentiable) : T</tt> — Second input operand for the logical operator.</p>
</dd>
<dt>Outputs</dt>
<dd id="_d82fe1b7-0f9d-6ec0-5094-398ef5d86fc5"><p id="_d29ad6aa-ed54-dd84-1ff3-974ec4ef1200"><tt>C (non-differentiable) : T1</tt> — Result tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_f6f7fd87-ae5a-7780-c96f-205e28427043"><p id="_c84e4b43-2632-ec1c-15ac-b6217a9f47ef">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_0c616e75-146a-e799-306f-c430628a1586"><p id="_a8174f52-098e-96d0-a32d-0f9b51e21936"><tt>T : tensor(bool)</tt> — Constrain input to boolean tensor.<br/> <tt>T1 : tensor(bool)</tt> — Constrain output to boolean tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_0b4b7605-86ae-8b49-870c-3de099e0f79b"><p id="_d76bfe43-837d-f446-c814-69cdaa17d8b0"><tt>test_and2d</tt>, <tt>test_and3d</tt>, <tt>test_and4d</tt>, <tt>test_and_bcast3v1d</tt>, <tt>test_and_bcast3v2d</tt>, <tt>test_and_bcast4v2d</tt>, <tt>test_and_bcast4v3d</tt>, <tt>test_and_bcast4v4d</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_5db57cd9-cc53-a991-e6a8-61d9efb0acb7"><p id="_0b2413f0-7c5b-4282-ddae-8f26d005f95a">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_f4773934-fdfb-0d54-ae32-a6d2ee97e04e" anchor="op-ai-onnx-default-argmax" obligation="normative">
<title id="_4f800ac3-f7af-bbe2-dc61-ad670ef79551">ArgMax</title>
<p id="_cb72b1cb-514e-2653-26ed-6a9f06bc3b93">Computes the indices of the max elements of the input tensor’s element along the provided axis. The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equals 0, then the resulting tensor has the reduced dimension pruned. If select_last_index is True (default False), the index of the last occurrence of the max is selected if the max appears more than once in the input. Otherwise the index of the first occurrence is selected. The type of the output tensor is integer.</p>

<dl id="_7d18b9d1-d76a-5131-7450-9ddd49ada41f"><dt>Domain</dt>
<dd id="_7ef03c61-9eab-05f5-b856-07a47b2018f6"><p id="_7c57cbf8-9ed3-ac52-b219-ec29423799c8"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_cfdff428-a88b-8fbb-0ccc-6796c3438fd5"><p id="_ede626b7-2dc7-ca83-ae89-35594912266a">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_a1197f35-defd-7803-3b48-9ff00ebc804e"><p id="_64c8bedb-4087-3391-1013-3db884134982">1, 11, 12</p>
</dd>
<dt>Inputs</dt>
<dd id="_3185044c-1e51-e61d-bf5a-c5d033368cf3"><p id="_6437e13e-94b9-cde0-b9e7-7f179c0853bf"><tt>data (non-differentiable) : T</tt> — An input tensor.</p>
</dd>
<dt>Outputs</dt>
<dd id="_4a71a2ea-cfda-77c8-8000-7b7e91f7ab74"><p id="_c90b2cc6-1e1e-e398-db4f-68a82d6b12ed"><tt>reduced (non-differentiable) : tensor(int64)</tt> — Reduced output tensor with integer data type.</p>
</dd>
<dt>Attributes</dt>
<dd id="_4bfeb8b8-25b0-1cd2-ee0c-82450dbb68f4"><p id="_851310a3-50f8-8824-5fce-420b3500af8c"><tt>axis : int (default is 0)</tt> — The axis in which to compute the arg indices. Accepted range is [-r, r-1] where r = rank(data).<br/> <tt>keepdims : int (default is 1)</tt> — Keep the reduced dimension or not, default 1 means keep reduced dimension.<br/> <tt>select_last_index : int (default is 0)</tt> — Whether to select the last index or the first index if the {name} appears in multiple indices, default is False (first index).</p>
</dd>
<dt>Type constraints</dt>
<dd id="_19082e01-3fdf-e5be-4589-c1c01fe89d96"><p id="_ae30e1d5-a1d8-4cb2-388c-ab1fed464de5"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to all numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_459cfe2c-a325-328a-1cab-aa22cd052d7d"><p id="_5d1c0822-ded5-4e5c-6c5e-e21ece0308ea"><tt>test_argmax_default_axis_example</tt>, <tt>test_argmax_default_axis_random</tt>, <tt>test_argmax_default_axis_example_select_last_index</tt>, <tt>test_argmax_default_axis_random_select_last_index</tt>, <tt>test_argmax_keepdims_example</tt>, <tt>test_argmax_keepdims_random</tt>, <tt>test_argmax_keepdims_example_select_last_index</tt>, <tt>test_argmax_keepdims_random_select_last_index</tt>, <tt>test_argmax_negative_axis_keepdims_example</tt>, <tt>test_argmax_negative_axis_keepdims_random</tt>, <tt>test_argmax_negative_axis_keepdims_example_select_last_index</tt>, <tt>test_argmax_negative_axis_keepdims_random_select_last_index</tt>, <tt>test_argmax_no_keepdims_example</tt>, <tt>test_argmax_no_keepdims_random</tt>, <tt>test_argmax_no_keepdims_example_select_last_index</tt>, <tt>test_argmax_no_keepdims_random_select_last_index</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_c498b52d-9c07-bc91-5fcb-426110e8e54c"><p id="_e1a429c4-4974-41d9-d07a-e74b8330ef58">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_f4c868bd-18b9-8273-7dee-4e2d5d7695d5" anchor="op-ai-onnx-default-argmin" obligation="normative">
<title id="_3ef5d609-8769-919d-4381-9473bbc6a12e">ArgMin</title>
<p id="_eac5f2f9-7b48-22d5-d258-4c9a69654d35">Computes the indices of the min elements of the input tensor’s element along the provided axis. The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equals 0, then the resulting tensor has the reduced dimension pruned. If select_last_index is True (default False), the index of the last occurrence of the min is selected if the min appears more than once in the input. Otherwise the index of the first occurrence is selected. The type of the output tensor is integer.</p>

<dl id="_625ddca7-b301-dfc7-5d9a-48f6168c28f7"><dt>Domain</dt>
<dd id="_c9f12cf5-327f-3da8-509b-6604c95c3bb2"><p id="_6a891486-28aa-0234-9df6-cfaa0ed00f98"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_56c88a4b-7193-85cf-b007-169eff5fb858"><p id="_c660d341-2e08-fb68-0a4d-4bee4f093749">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_f8b2cab0-ae1e-a2f3-e0ee-30b67ca4f718"><p id="_ead09c29-6195-2a35-1c5f-8291e3d39d8d">1, 11, 12</p>
</dd>
<dt>Inputs</dt>
<dd id="_553b56ab-f18b-5488-c73a-f768d5e3bde7"><p id="_3a38dc07-2fe2-e794-a6a3-e665591d1d20"><tt>data (non-differentiable) : T</tt> — An input tensor.</p>
</dd>
<dt>Outputs</dt>
<dd id="_14cef6ea-c6b9-29cd-96bd-2225ca2b6b5e"><p id="_418974a9-6536-b301-f644-eb5fa5739bdf"><tt>reduced (non-differentiable) : tensor(int64)</tt> — Reduced output tensor with integer data type.</p>
</dd>
<dt>Attributes</dt>
<dd id="_30a777ca-1382-f6d6-061e-e89be685cc9c"><p id="_614406b9-0c1a-7752-40fb-3f5243cc431a"><tt>axis : int (default is 0)</tt> — The axis in which to compute the arg indices. Accepted range is [-r, r-1] where r = rank(data).<br/> <tt>keepdims : int (default is 1)</tt> — Keep the reduced dimension or not, default 1 means keep reduced dimension.<br/> <tt>select_last_index : int (default is 0)</tt> — Whether to select the last index or the first index if the {name} appears in multiple indices, default is False (first index).</p>
</dd>
<dt>Type constraints</dt>
<dd id="_8d819d25-21ff-5e7e-2bae-406b582aed21"><p id="_034ce121-8116-33f5-e2df-19531d4befe2"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to all numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_30e3fd16-230f-522a-bd64-03a069e9560e"><p id="_e4d2d506-f60a-68eb-f1b1-22623645df73"><tt>test_argmin_default_axis_example</tt>, <tt>test_argmin_default_axis_random</tt>, <tt>test_argmin_default_axis_example_select_last_index</tt>, <tt>test_argmin_default_axis_random_select_last_index</tt>, <tt>test_argmin_keepdims_example</tt>, <tt>test_argmin_keepdims_random</tt>, <tt>test_argmin_keepdims_example_select_last_index</tt>, <tt>test_argmin_keepdims_random_select_last_index</tt>, <tt>test_argmin_negative_axis_keepdims_example</tt>, <tt>test_argmin_negative_axis_keepdims_random</tt>, <tt>test_argmin_negative_axis_keepdims_example_select_last_index</tt>, <tt>test_argmin_negative_axis_keepdims_random_select_last_index</tt>, <tt>test_argmin_no_keepdims_example</tt>, <tt>test_argmin_no_keepdims_random</tt>, <tt>test_argmin_no_keepdims_example_select_last_index</tt>, <tt>test_argmin_no_keepdims_random_select_last_index</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_d6d96042-4ca2-bd06-4d99-75bc408c2340"><p id="_622422aa-ce5c-68dd-d13c-c2c25b019635">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_5a70a479-c534-a215-7183-4ca49cd580f6" anchor="op-ai-onnx-default-asin" obligation="normative">
<title id="_1f8d4d31-a8b5-802e-970b-369af77f7e22">Asin</title>
<p id="_ed21542d-760a-d971-6c45-948048b666e3">Calculates the arcsine (inverse of sine) of the given input tensor, element-wise.</p>

<dl id="_efb86968-6ce8-1c03-7f77-6bb1274b7b25"><dt>Domain</dt>
<dd id="_5a30ef82-62ed-952c-d70b-0ece205c88be"><p id="_750b311d-79d0-f6c9-afee-92671093b136"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_45d685f3-7b76-bae7-dcf6-da3f70d574d2"><p id="_e1412fd9-2eb2-920e-bc51-d93365dbf154">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_4f013b31-cd53-7d71-3368-ba8929eb3e33"><p id="_94290cee-3669-6899-1948-7c731f72a1ea">7</p>
</dd>
<dt>Inputs</dt>
<dd id="_d0a07cad-e99a-6609-542b-9300c2cc0f4f"><p id="_e8d74879-7eaf-8df6-27e0-b30db720ced7"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_1a40e8bf-0f4d-ff73-1d3a-d6bae8018d23"><p id="_1b4076d9-0db8-426b-0ae2-38e671f0c57f"><tt>output (differentiable) : T</tt> — The arcsine of the input tensor computed element-wise</p>
</dd>
<dt>Attributes</dt>
<dd id="_46757f11-0899-92df-12a8-e21b7ee8e6c7"><p id="_2dc4b71d-951b-dd1e-7bce-d26df7d3c661">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_7be4547e-5c14-18ab-0e24-9095400ce4a1"><p id="_cff5c86a-dc72-e24b-84c6-f062497368d0"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_2635f1fc-77f1-5db2-e280-cd3f7f5c1e61"><p id="_ee27f369-bcb3-db80-8627-da23f9fb4ad0"><tt>test_asin_example</tt>, <tt>test_asin</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_35ae59a0-ba9b-fa7e-7f1c-5e0670b835f4"><p id="_d77501cf-df25-0f86-8137-c699dcbd832d">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_eba714ba-bd63-2f4d-83b4-bbc57bd1771b" anchor="op-ai-onnx-default-asinh" obligation="normative">
<title id="_638ee824-ba38-3d3e-6a2e-97c812bcdedd">Asinh</title>
<p id="_7f95fe55-eb20-2f0e-8cee-c5d0d853e7b4">Calculates the hyperbolic arcsine of the given input tensor element-wise.</p>

<dl id="_77da8f55-d151-02f5-bd78-2da883307eb1"><dt>Domain</dt>
<dd id="_c2730f90-9c26-da95-b5ac-3195ec5fe60f"><p id="_f80757cd-a1a7-eaf1-ec51-03ba46278f75"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_c4690bbd-a122-771b-a3dc-57c3636f8006"><p id="_ce33222b-eb62-c348-6e56-b3e64c645f50">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_a46b26d6-9300-60d4-5c92-3474a626ec20"><p id="_eebbfd06-9d85-c517-656a-f64e57644ee5">9</p>
</dd>
<dt>Inputs</dt>
<dd id="_45acd65c-dd3d-f284-911a-45a3c45dc9aa"><p id="_f6a3a358-034b-2406-fd17-cfa382f8f3af"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_4c3ece0f-f218-1525-3736-9e1bc8acc5e2"><p id="_b42f625b-3e4c-6d18-b3e9-31aa236ea58a"><tt>output (differentiable) : T</tt> — The hyperbolic arcsine values of the input tensor computed element-wise</p>
</dd>
<dt>Attributes</dt>
<dd id="_89f2cbb3-014f-ae62-f32b-18dc5ff57988"><p id="_d27e8d70-0b80-eef1-a218-808cb0ad70a4">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_524b003b-eca3-1f4b-9074-acec7e17b18d"><p id="_68ad1e2f-216d-2344-a212-d91ae5af2912"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_ca19563a-5d9a-b2b4-bfc4-92ecb5c25bda"><p id="_5aac6ae5-afd7-0f8c-5eaf-e18d767c1632"><tt>test_asinh_example</tt>, <tt>test_asinh</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_38749523-b477-7d83-d83e-cee9cc4748c1"><p id="_bbf76cec-7725-9a1a-aa89-63aa1f10e69c">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_ba4b5ef3-c31e-a007-35e0-29ce3fb24633" anchor="op-ai-onnx-default-atan" obligation="normative">
<title id="_20eb5ea4-da21-a4cb-b15a-6a9378f030eb">Atan</title>
<p id="_4f320a23-9ef5-3d5f-6770-c6ab091cdd48">Calculates the arctangent (inverse of tangent) of the given input tensor, element-wise.</p>

<dl id="_19e4675e-b83b-06d5-4714-8d8a9d790bf8"><dt>Domain</dt>
<dd id="_3fbaa47c-9a35-ab23-ef34-73cd15acb2ee"><p id="_6d2c118b-ab5e-4201-f70d-95beb72b7b00"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_af1840b6-fc18-024d-fbc2-d68fd1d85751"><p id="_b0ce70bb-f438-88b0-af77-dd7481f22973">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_fbcd601e-f8e1-e82c-edae-77668f612d7f"><p id="_6d6e1660-ea8c-8b88-4a0f-3253ef491907">7</p>
</dd>
<dt>Inputs</dt>
<dd id="_8fde2b2a-7713-0874-708c-3071098efde4"><p id="_002ff7c1-bb93-918a-a061-e8c933e52c90"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_feab06db-a9e9-5629-3250-ad877c26cd47"><p id="_c40eefa8-3cf7-7293-28a9-948f3f721b2b"><tt>output (differentiable) : T</tt> — The arctangent of the input tensor computed element-wise</p>
</dd>
<dt>Attributes</dt>
<dd id="_c1a71d4a-b5f2-41cb-6047-d901fa6173a2"><p id="_1a61c10b-f61c-d654-7f5a-91752ac9436a">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_400fbdfa-613e-cb27-d779-9d944c8c02a0"><p id="_8b20eea0-da76-2c2f-4e4b-d850e41fb3e7"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_a9397ba5-695c-dd87-20c9-d7705209606f"><p id="_01a22bcd-0010-365e-fcd9-c50ba1deaf14"><tt>test_atan_example</tt>, <tt>test_atan</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_7824ac8b-86b3-b2c3-1043-21cd76fcf3b3"><p id="_c72740c5-26e1-6be4-0219-ff575f6310d6">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_8c893503-39d5-b022-483a-ed8ad508079d" anchor="op-ai-onnx-default-atanh" obligation="normative">
<title id="_fdf84cb2-34a2-b9d6-7d03-7968b79e0f01">Atanh</title>
<p id="_eae3b6f5-7bfc-158e-02dc-a6551b20ff9f">Calculates the hyperbolic arctangent of the given input tensor element-wise.</p>

<dl id="_0829f782-e846-c7f3-1848-39dbd5912bca"><dt>Domain</dt>
<dd id="_d310262d-f19f-9fab-defb-8965aa99cd01"><p id="_d7c78c85-2561-534d-dc0f-fd74509afad8"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_de1eb0d9-69b7-852c-11cb-48aabb2df2b9"><p id="_5d18e14a-67e1-00b1-7120-8768fad71813">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_75165db8-fa95-6ff2-2a51-453d1d55891f"><p id="_3a5e6e6f-e5b1-c685-0ee8-082c457320b0">9</p>
</dd>
<dt>Inputs</dt>
<dd id="_e4fb5fa9-bad7-c157-beca-e922456336d8"><p id="_b5e519fa-253e-8dc0-b4f5-b2ef7cbcdf7f"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_d25447b9-77e1-ad13-b190-c6b9a12644d6"><p id="_e347e370-05e0-e4a7-84b6-d770d7b58988"><tt>output (differentiable) : T</tt> — The hyperbolic arctangent values of the input tensor computed element-wise</p>
</dd>
<dt>Attributes</dt>
<dd id="_a70b0203-68d4-0c53-dae4-131d91a3f23a"><p id="_b2e47949-ac26-309d-ffa0-f8864b9acc59">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_7418dd96-ddd9-6c7b-bb0b-89c92483eb66"><p id="_032628cd-011b-6491-2fac-9cc04f912ff7"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_978cf67a-dd6d-d359-f1e1-c4735848e4ff"><p id="_5335cf24-0566-35b7-5cab-e59b5839816a"><tt>test_atanh_example</tt>, <tt>test_atanh</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_960273cc-2389-98b3-1068-ee0772155264"><p id="_b60962c6-cda0-94b2-235a-ff346222a53a">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_8c7dffdd-4432-c99d-2676-5903bc7a4dd4" anchor="op-ai-onnx-default-attention" obligation="normative">
<title id="_bfab9726-76bc-2b47-c5ae-92963ffa6014">Attention</title>
<p id="_e707fa50-4334-93a4-f60a-b8b9a2420a34">Computes scaled dot product attention on query, key and value tensors, using an optional attention mask if passed.</p>

<p id="_4cfae29e-6134-7da2-be8d-3767b9a98476">This operator covers self and cross variants of the attention operation based on sequence lengths of K, Q and V.</p>

<p id="_90af6978-8a98-3345-ceb1-331e4f5461f8">For self attention, <tt>kv_sequence_length</tt> equals to <tt>q_sequence_length</tt>.</p>

<p id="_166262ba-4d61-bdb9-59d8-c34e101a51df">For cross attention, query and key might have different lengths.</p>

<p id="_e6512018-5188-b6c1-0402-95ebd3293ebc">This operator also covers the 3 following variants based on the number of heads: 1) Multi-headed Attention (MHA): Described in the paper  <link target="https://arxiv.org/pdf/1706.03762"/>, <tt>q_num_heads = kv_num_heads</tt>. 2) Group-query Attention (GQA): Described in the paper  <link target="https://arxiv.org/pdf/2305.13245"/>, <tt>q_num_heads &gt; kv_num_heads</tt>, <tt>q_num_heads % kv_num_heads == 0</tt>. 3) Multi-query Attention (MQA): Described in the paper  <link target="https://arxiv.org/pdf/1911.02150"/>, <tt>q_num_heads &gt; kv_num_heads</tt>, <tt>kv_num_heads=1</tt>.</p>

<p id="_cecf8502-bfb2-f4e3-289d-e5c77d4161c3">Attention bias to be added is calculated based on <tt>attn_mask</tt> input and <tt>is_causal</tt> attribute: 1)  <tt>attn_mask</tt>: A boolean mask where a value of <tt>True</tt> indicates that the element should take part in attention or a float mask of the same type as query, key, value that is added to the attention score. 2) If  <tt>is_causal</tt> is set to <tt>1</tt>, causal masking is applied with bottom-right (offset-aware) alignment: query <tt>i</tt> attends key <tt>j</tt> iff <tt>j &lt;= i + offset</tt>, as illustrated below.</p>

<sourcecode id="_754979bd-50e4-284e-dacf-15c23ce5daa3" unnumbered="true"><body>  2D causal mask for Attention (PR onnx/onnx#8068)
   S_q=4 queries, S_k=8 keys
   Rule: query i attends key j iff j &lt;= i + offset
         offset = nonpad_kv_seqlen - S_q

   nonpad_kv_seqlen=4, offset=4-4=0

          k0  k1  k2  k3  k4  k5  k6  k7
         +----+----+----+----+----+----+----+----+
    q0   | ## |    |    |    |    |    |    |    |
         +----+----+----+----+----+----+----+----+
    q1   | ## | ## |    |    |    |    |    |    |
         +----+----+----+----+----+----+----+----+
    q2   | ## | ## | ## |    |    |    |    |    |
         +----+----+----+----+----+----+----+----+
    q3   | ## | ## | ## | ## |    |    |    |    |
         +----+----+----+----+----+----+----+----+


   nonpad_kv_seqlen=8, offset=8-4=4

          k0  k1  k2  k3  k4  k5  k6  k7
         +----+----+----+----+----+----+----+----+
    q0   | ## | ## | ## | ## | ## |    |    |    |
         +----+----+----+----+----+----+----+----+
    q1   | ## | ## | ## | ## | ## | ## |    |    |
         +----+----+----+----+----+----+----+----+
    q2   | ## | ## | ## | ## | ## | ## | ## |    |
         +----+----+----+----+----+----+----+----+
    q3   | ## | ## | ## | ## | ## | ## | ## | ## |
         +----+----+----+----+----+----+----+----+</body></sourcecode>


<p id="_7dda9b7a-1447-2cac-e5f7-900602f46ee3">With <tt>nonpad_kv_seqlen=4</tt> (offset=0), the mask is the standard lower-triangular. With <tt>nonpad_kv_seqlen=8</tt> (offset=4), the diagonal shifts right by 4, so each query sees the 4 additional valid cached keys.</p>

<p id="_8f4847a9-8643-6bff-7e36-0395357588b8"><tt>offset</tt> is the count of valid keys preceding the current query block: <tt>offset = past_sequence_length</tt> when <tt>past_key</tt> is provided; <tt>offset = nonpad_kv_seqlen - q_sequence_length</tt> (per batch) when an external cache is indicated by <tt>nonpad_kv_seqlen</tt> without <tt>past_key</tt>; <tt>offset = 0</tt> when neither is provided (the no-cache case, which reduces to the standard lower-triangular mask). When <tt>offset &lt; 0</tt> (<tt>nonpad_kv_seqlen &lt; q_sequence_length</tt>, i.e. more query tokens than cached keys) the leading query rows have an empty key set (no key satisfies <tt>j &lt;= i + offset</tt>) and are fully masked. The causal frontier is computed independently of <tt>attn_mask</tt> and is then composed with it additively: a boolean <tt>attn_mask</tt> intersects the allowed set (its disallowed positions contribute <tt>-inf</tt> to the bias), while a float <tt>attn_mask</tt> is added to the attention scores rather than disabling positions. A fully-masked query row (no key attended, including the negative-offset leading rows) produces a zero output row, not <tt>NaN</tt>, for both <tt>Y</tt> and the mode-<tt>3</tt> <tt>qk_matmul_output</tt> debug output; the mode-<tt>3</tt> <tt>qk_matmul_output</tt> is emitted at the operator’s output precision (<tt>T1</tt>).</p>

<p id="_bb842114-d5c9-e666-1f62-fc75a9a0fe27"><tt>left_window_size</tt> and <tt>right_window_size</tt> independently restrict the keys visible to each query. A query at absolute position <tt>p = offset + query_index</tt> attends keys <tt>j</tt> satisfying <tt>p - left_window_size &lt;= j &lt;= p + right_window_size</tt> for each nonnegative bound. A value of <tt>-1</tt> leaves that side unbounded. For example, <tt>(left_window_size=2, right_window_size=0)</tt> is a causal left-looking window containing the current key and two preceding keys, while <tt>(left_window_size=2, right_window_size=1)</tt> is an asymmetric bidirectional window. Window bounds are composed with <tt>is_causal</tt> and <tt>attn_mask</tt>; when <tt>is_causal=1</tt>, the causal upper bound still excludes future keys.</p>

<sourcecode id="_6779cf86-479c-1efb-d4aa-bb401d33172b" unnumbered="true"><body>  2D sliding-window mask for Attention (opset 25)
   S_q=4 queries, S_k=6 keys, left_window_size=2, right_window_size=1, offset=0

          k0  k1  k2  k3  k4  k5
         +----+----+----+----+----+----+
    q0   | ## | ## |    |    |    |    |
         +----+----+----+----+----+----+
    q1   | ## | ## | ## |    |    |    |
         +----+----+----+----+----+----+
    q2   | ## | ## | ## | ## |    |    |
         +----+----+----+----+----+----+
    q3   |    | ## | ## | ## | ## |    |
         +----+----+----+----+----+----+

   q0 attends {k0,k1}, q1 attends {k0,k1,k2}, q2 attends {k0,k1,k2,k3},
   q3 attends {k1,k2,k3,k4}.</body></sourcecode>


<p id="_8fc5cbd6-b6bc-18ef-884f-ee707cbad48f">With respect to KV cache update, this operator allows the following two use cases:</p>

<p id="_78c4e128-2aee-424a-8845-d24d91f3ef80">1) Cache update happens inside the Attention operator. In this case, the <tt>K</tt> and <tt>V</tt> inputs contain only the incoming tokens for the current autoregressive step, and the four optional inputs/outputs past and present key and value are all needed. The Attention op performs a Concat operation on the past and incoming key and value to form the present key and value, respectively. Note that this only works correctly for the special case where the past key and value do not contain padded tokens. 2) Cache update happens outside the Attention operator (for example, through the  <tt>TensorScatter</tt> operator). In this case, the  <tt>K</tt> and <tt>V</tt> inputs correspond to the entire cache tensor, so the four optional inputs/outputs past and present key and value should not be used. An additional input  <tt>nonpad_kv_seqlen</tt> of shape (batch_size,) may be provided to indicate the number of non-padding tokens in each sample of the batch to save unnecessary computation. Here, the kv_sequence dimension of  <tt>attn_mask</tt> can be shorter than <tt>K</tt> and <tt>V</tt>, but still needs to be at least as long as the maximum value of  <tt>nonpad_kv_seqlen</tt>.</p>

<p id="_5813fbc3-e3b1-2f55-e6ce-b3b4bd02aeac">Both past and present state key/values are optional. They shall be used together, and not allowed to use only one of them. The following pattern is applied to the Q, K and V inputs after appropriate reshaping of K and V inputs based on sequence lengths and num heads provided:</p>

<sourcecode id="_5df8dcd8-731b-bfe8-cf83-1e0736b2679e" unnumbered="true"><body>  The following pattern is applied by this operator:
      Q          K          V
      |          |          |
Q*sqrt(scale) K*sqrt(scale) |
      |          |          |
      |       Transpose     |
      |          |          |
      ---MatMul---          |
            |               |
  softcap (if provided)     |
            |               |
 at_mask---Add              |
            |               |
         Softmax            |
            |               |
            -----MatMul------
                   |
                   Y</body></sourcecode>


<dl id="_85f9a8d8-82b1-caa5-35db-87423caaeff2"><dt>Domain</dt>
<dd id="_bbf8757a-34c9-7984-5709-d20916b991af"><p id="_f1c9ad3e-6543-6916-0379-2117178a4ada"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_d223f28c-46d8-8191-c5a2-87f5fdb5247f"><p id="_a5a7f2bf-7b13-93d2-f675-7b8a2575e4f8">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_d60a46af-585e-3ec3-190e-ebde6b5bf5af"><p id="_907bf05b-e04c-d76b-0089-3980f4fbf370">23, 24</p>
</dd>
<dt>Inputs (3 — 7)</dt>
<dd id="_bec849e2-6fa0-3e26-51a2-74aed18ced0f"><p id="_a005fefc-389b-a896-986a-660a209b3fbf"><tt>Q : T1</tt> — Query tensor. 4D tensor with shape <tt>(batch_size, q_num_heads, q_sequence_length, head_size)</tt> or 3D tensor with shape <tt>(batch_size, q_sequence_length, q_hidden_size)</tt>. For cases with a 3D input tensor, <tt>q_hidden_size = q_num_heads * head_size</tt><br/> <tt>K : T1</tt> — Key tensor. 4D tensor with shape <tt>(batch_size, kv_num_heads, kv_sequence_length, head_size)</tt> or 3D tensor with shape <tt>(batch_size, kv_sequence_length, k_hidden_size)</tt>. For cases with a 3D input tensor, <tt>k_hidden_size = kv_num_heads * head_size</tt><br/> <tt>V : T2</tt> — Value tensor. 4D tensor with shape <tt>(batch_size, kv_num_heads, kv_sequence_length, v_head_size)</tt> or 3D tensor with shape <tt>(batch_size, kv_sequence_length, v_hidden_size)</tt>. For cases with a 3D input tensor, <tt>v_hidden_size = kv_num_heads * v_head_size</tt><br/> <tt>attn_mask (optional) : U</tt> — Attention mask. Shape must be broadcastable to <tt>(batch_size, q_num_heads, q_sequence_length, total_sequence_length)</tt> where <tt>total_sequence_length = past_sequence_length + kv_sequence_length</tt>. The last dimension can also be shorter than <tt>total_sequence_length</tt> and will be padded to <tt>total_sequence_length</tt> with negative infinity. Two types of masks are supported: a boolean mask where a value of <tt>True</tt> indicates that the element should take part in attention, or a float mask of the same type as query, key, value that is added to the attention score.<br/> <tt>past_key (optional) : T1</tt> — Past state for key with shape <tt>(batch_size, kv_num_heads, past_sequence_length, head_size)</tt>. Must be used together with <tt>past_value</tt> input.<br/> <tt>past_value (optional) : T2</tt> — Past state for value with shape <tt>(batch_size, kv_num_heads, past_sequence_length, v_head_size)</tt>. Must be used together with <tt>past_key</tt> input.<br/> <tt>nonpad_kv_seqlen (optional) : tensor(int64)</tt> — A vector of integers of shape <tt>(batch_size,)</tt> that indicates the number of valid (i.e., non-padding) tokens in each sample. A padding mask can be derived from this. This should not be used together with <tt>past_key</tt> and <tt>past_value</tt> inputs or <tt>present_key</tt> and <tt>present_value</tt> outputs (see the KV cache use cases in the operator description).</p>
</dd>
<dt>Outputs (1 — 4)</dt>
<dd id="_6046386d-d910-eb51-f022-77b20332d746"><p id="_c0635644-15b3-67d6-cfac-4122f8894c2a"><tt>Y : T1</tt> — The output tensor. 4D tensor with shape <tt>(batch_size, q_num_heads, q_sequence_length, v_head_size)</tt> or 3D tensor with shape <tt>(batch_size, q_sequence_length, hidden_size)</tt>. For cases with a 3D input tensor, <tt>hidden_size = q_num_heads * v_head_size</tt><br/> <tt>present_key (optional) : T1</tt> — Updated key cache with shape <tt>(batch_size, kv_num_heads, total_sequence_length, head_size)</tt> where <tt>total_sequence_length = past_sequence_length + kv_sequence_length</tt>.<br/> <tt>present_value (optional) : T2</tt> — Updated value cache with shape <tt>(batch_size, kv_num_heads, total_sequence_length, v_head_size)</tt> where <tt>total_sequence_length = past_sequence_length + kv_sequence_length</tt>.<br/> <tt>qk_matmul_output (optional) : T1</tt> — The output of QK matmul. 4D tensor with shape <tt>(batch_size, q_num_heads, q_sequence_length, total_sequence_length)</tt> where <tt>total_sequence_length = past_sequence_length + kv_sequence_length</tt>.</p>
</dd>
<dt>Attributes</dt>
<dd id="_406aab21-fcce-0765-9104-a9ae74c413b2"><p id="_84d0411c-b53f-22bf-1874-17bb771d81bf"><tt>is_causal : int (default is 0)</tt> — If set to <tt>1</tt>, causal masking is applied. For a square Q/K (no cache offset) this is a lower-triangular matrix. In general the mask is bottom-right (offset-aware): query in-block index <tt>i</tt> attends key <tt>j</tt> iff <tt>j &lt;= i + offset</tt>, where <tt>offset</tt> is the count of valid keys preceding the query block (<tt>past_sequence_length</tt> for an internal <tt>past_key</tt> cache, or <tt>nonpad_kv_seqlen - q_sequence_length</tt> per batch for an external cache). When <tt>offset = 0</tt> this reduces to the lower-triangular (top-left) mask.<br/> <tt>kv_num_heads : int</tt> — Number of heads of key and value. Must be used with 3D inputs of Q, K and V.<br/> <tt>left_window_size : int (default is -1)</tt> — Maximum number of positions to the left of the current absolute query position that may be attended. A value of <tt>0</tt> allows the current position but no preceding position, while <tt>-1</tt> leaves the left side unbounded. This bound is composed with <tt>is_causal</tt> and <tt>attn_mask</tt>.<br/> <tt>q_num_heads : int</tt> — Number of heads of query. Must be used with 3D inputs of Q, K and V.<br/> <tt>qk_matmul_output_mode : int (default is 0)</tt> — Determines what the optional 4th output contains: <tt>0</tt> (default): raw QK matmul result; <tt>1</tt>: after softcap (before bias addition); <tt>2</tt>: QK + softcap + bias; <tt>3</tt>: post-softmax probabilities (after fully-masked-row guard). In mode <tt>3</tt>, a fully-masked query row (every key disallowed) is a zero row, consistent with the corresponding row of the primary output <tt>Y</tt>. The mode-<tt>3</tt> output is emitted at the operator’s output precision (<tt>T1</tt>); when <tt>softmax_precision</tt> differs from <tt>T1</tt> this is a cast of the softmax result to <tt>T1</tt>.<br/> <tt>right_window_size : int (default is -1)</tt> — Maximum number of positions to the right of the current absolute query position that may be attended. A value of <tt>0</tt> allows the current position but no following position, while <tt>-1</tt> leaves the right side unbounded. Set <tt>is_causal=0</tt> to use a positive right window.<br/> <tt>scale : float</tt> — Scaling factor applied to $Q*K^T$. Default value is <tt>1/sqrt(head_size)</tt>. To prevent <link target="https://tinyurl.com/sudb9s96">numerical overflow</link>, scale <tt>Q</tt>, <tt>K</tt> by <tt>sqrt(scale)</tt> before matmul.<br/> <tt>softcap : float (default is 0.0)</tt> — Soft cap for attention logits, applied as <tt>softcap * tanh(logits / softcap)</tt>. Default value of <tt>0.0</tt> means no soft capping is applied. The soft cap is applied before mask / bias addition and softmax.<br/> <tt>softmax_precision : int</tt> — Specifies the precision for softmax computation. If provided, the attention weights will be cast to this type before softmax and then cast back to the original type. Supported values are: <tt>1</tt> (FLOAT), <tt>10</tt> (FLOAT16), <tt>11</tt> (DOUBLE), <tt>16</tt> (BFLOAT16).</p>
</dd>
<dt>Type constraints</dt>
<dd id="_a5c57fc0-b65a-f771-cd74-d231b9d9d1b8"><p id="_04f15e80-5c1a-e19d-1b7b-71bc995259b1"><tt>T1 : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain Q and K inputs types to float tensors.<br/> <tt>T2 : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain V input types to float tensors.<br/> <tt>U : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(bool)</tt> — Constrain output ‘mask’ types to boolean tensors and input types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_a67704e7-dd35-c26b-ed69-27d84a344072"><p id="_dfc71f71-e60e-23af-36b9-8ca56061301c"><tt>test_attention_4d</tt>, <tt>test_attention_23_boolmask_fullymasked_row_nan_robustness</tt>, <tt>test_attention_23_fullymasked_qk_matmul_output_mode3_zero</tt>, <tt>test_attention_24_fullymasked_qk_matmul_output_mode3_zero</tt>, <tt>test_attention_24_qk_matmul_output_mode3_softmax_precision</tt>, <tt>test_attention_3d</tt>, <tt>test_attention_3d_attn_mask</tt>, <tt>test_attention_3d_causal</tt>, <tt>test_attention_3d_causal_bf16</tt>, <tt>test_attention_3d_diff_heads_sizes</tt>, <tt>test_attention_3d_diff_heads_sizes_attn_mask</tt>, <tt>test_attention_3d_diff_heads_sizes_causal</tt>, <tt>test_attention_3d_diff_heads_sizes_scaled</tt>, <tt>test_attention_3d_diff_heads_sizes_softcap</tt>, <tt>test_attention_3d_diff_heads_with_past_and_present</tt>, <tt>test_attention_3d_gqa</tt>, <tt>test_attention_3d_gqa_attn_mask</tt>, <tt>test_attention_3d_gqa_causal</tt>, <tt>test_attention_3d_gqa_scaled</tt>, <tt>test_attention_3d_gqa_softcap</tt>, <tt>test_attention_3d_gqa_with_past_and_present</tt>, <tt>test_attention_3d_local_window</tt>, <tt>test_attention_3d_scaled</tt>, <tt>test_attention_3d_softcap</tt>, <tt>test_attention_3d_transpose_verification</tt>, <tt>test_attention_3d_with_past_and_present</tt>, <tt>test_attention_3d_with_past_and_present_qk_matmul</tt>, <tt>test_attention_3d_with_past_and_present_qk_matmul_bias</tt>, <tt>test_attention_3d_with_past_and_present_qk_matmul_softcap</tt>, <tt>test_attention_3d_with_past_and_present_qk_matmul_softmax</tt>, <tt>test_attention_4d_causal_nonpad_attn_mask_composition</tt>, <tt>test_attention_4d_causal_nonpad_batch_prefill</tt>, <tt>test_attention_4d_causal_nonpad_continued_prefill</tt>, <tt>test_attention_4d_causal_nonpad_negative_offset_structural_empty</tt>, <tt>test_attention_4d_causal_with_past_and_present</tt>, <tt>test_attention_4d_diff_heads_mask4d_padded_kv</tt>, <tt>test_attention_4d_gqa_causal_nonpad_decode</tt>, <tt>test_attention_4d_gqa_causal_nonpad_decode_fp16</tt>, <tt>test_attention_4d_attn_mask_3d</tt>, <tt>test_attention_4d_attn_mask_3d_causal</tt>, <tt>test_attention_4d_attn_mask_4d</tt>, <tt>test_attention_4d_attn_mask_4d_causal</tt>, <tt>test_attention_4d_attn_mask</tt>, <tt>test_attention_4d_attn_mask_bool</tt>, <tt>test_attention_4d_attn_mask_bool_4d</tt>, <tt>test_attention_4d_attn_mask_causal_bf16</tt>, <tt>test_attention_bidirectional_window</tt>, <tt>test_attention_4d_causal</tt>, <tt>test_attention_4d_causal_bf16</tt>, <tt>test_attention_causal_boolmask_nan_robustness</tt>, <tt>test_attention_4d_causal_fp16</tt>, <tt>test_attention_4d_causal_padded_kv_bf16</tt>, <tt>test_attention_4d_diff_heads_sizes</tt>, <tt>test_attention_4d_diff_heads_sizes_attn_mask</tt>, <tt>test_attention_4d_diff_heads_sizes_causal</tt>, <tt>test_attention_4d_diff_heads_sizes_scaled</tt>, <tt>test_attention_4d_diff_heads_sizes_softcap</tt>, <tt>test_attention_4d_diff_heads_with_past_and_present</tt>, <tt>test_attention_4d_diff_heads_with_past_and_present_mask3d</tt>, <tt>test_attention_4d_diff_heads_with_past_and_present_mask4d</tt>, <tt>test_attention_4d_fp16</tt>, <tt>test_attention_4d_gqa</tt>, <tt>test_attention_4d_gqa_attn_mask</tt>, <tt>test_attention_4d_gqa_causal</tt>, <tt>test_attention_4d_gqa_scaled</tt>, <tt>test_attention_4d_gqa_softcap</tt>, <tt>test_attention_4d_gqa_with_past_and_present</tt>, <tt>test_attention_4d_gqa_with_past_and_present_fp16</tt>, <tt>test_attention_local_window</tt>, <tt>test_attention_local_window_default</tt>, <tt>test_attention_local_window_ext_cache_float16_mask</tt>, <tt>test_attention_local_window_ext_cache_rank2_mask</tt>, <tt>test_attention_local_window_ext_cache_rank3_head_mask</tt>, <tt>test_attention_local_window_ext_cache_rank4_batch_mask</tt>, <tt>test_attention_local_window_gqa_rank4_mask</tt>, <tt>test_attention_local_window_rank1_boolean_mask</tt>, <tt>test_attention_local_window_with_past</tt>, <tt>test_attention_4d_padded_kv_bf16</tt>, <tt>test_attention_4d_scaled</tt>, <tt>test_attention_4d_softcap</tt>, <tt>test_attention_4d_softcap_neginf_mask</tt>, <tt>test_attention_4d_softcap_neginf_mask_poison</tt>, <tt>test_attention_4d_with_past_and_present</tt>, <tt>test_attention_4d_with_past_and_present_qk_matmul</tt>, <tt>test_attention_4d_with_past_and_present_qk_matmul_bias</tt>, <tt>test_attention_4d_with_past_and_present_qk_matmul_bias_3d_mask</tt>, <tt>test_attention_4d_with_past_and_present_qk_matmul_bias_3d_mask_causal</tt>, <tt>test_attention_4d_with_past_and_present_qk_matmul_bias_4d_mask</tt>, <tt>test_attention_4d_with_past_and_present_qk_matmul_bias_4d_mask_causal</tt>, <tt>test_attention_4d_with_qk_matmul</tt>, <tt>test_attention_4d_with_qk_matmul_bias</tt>, <tt>test_attention_4d_with_qk_matmul_softcap</tt>, <tt>test_attention_4d_with_qk_matmul_softmax</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_4b58771a-739f-3cbf-2049-c6998c1d2e9c"><p id="_94c18328-5937-71ed-27f7-4de776d16cef">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_ec995ed4-4e71-b8ba-e5f9-ec19e3c07224" anchor="op-ai-onnx-default-averagepool" obligation="normative">
<title id="_9ba9bd13-3e38-59ef-9727-c57d65560f68">AveragePool</title>
<p id="_c1b899c1-1cef-0fa7-5dfc-22eb9c11c531">AveragePool consumes an input tensor X and applies average pooling across  the tensor according to kernel sizes, stride sizes, and pad lengths.  average pooling consisting of computing the average on all values of a  subset of the input tensor according to the kernel size and downsampling the  data into the output tensor Y for further processing. The output spatial shape is calculated differently  depending on whether explicit padding is used, where pads is employed, or auto padding is used, where auto_pad is utilized.  With explicit padding (<link target="https://pytorch.org/docs/stable/generated/torch.nn.MaxPool2d.html?highlight=maxpool#torch.nn.MaxPool2d):"/></p>

<sourcecode id="_6b83bbdd-b00c-b140-7ef8-e127ca5854c5" unnumbered="true"><body> output_spatial_shape[i] = floor((input_spatial_shape[i] + pad_shape[i] - dilation[i] * (kernel_shape[i] - 1) - 1) / strides_spatial_shape[i] + 1)</body></sourcecode>


<p id="_4b9ff57e-7b54-a975-ef87-8ce25ccbd849">or</p>

<sourcecode id="_6332eae2-eb95-8c20-26a5-070692c1cdf7" unnumbered="true"><body> output_spatial_shape[i] = ceil((input_spatial_shape[i] + pad_shape[i] - dilation[i] * (kernel_shape[i] - 1) - 1) / strides_spatial_shape[i] + 1)</body></sourcecode>


<p id="_dfda38ad-1993-19cd-687d-447771d4132a">if ceil_mode is enabled. <tt>pad_shape[i]</tt> is the sum of pads along axis <tt>i</tt>. Sliding windows that would start in the right padded region are ignored.</p>

<p id="_1f83c9be-6e32-c463-398d-a186f177f435"><tt>auto_pad</tt> is a DEPRECATED attribute. If you are using them currently, the output spatial shape will be following when ceil_mode is enabled:</p>

<sourcecode id="_9323cd00-5a03-7ece-a033-eae44f99350f" unnumbered="true"><body> VALID: output_spatial_shape[i] = ceil((input_spatial_shape[i] - ((kernel_spatial_shape[i] - 1) * dilations[i] + 1) + 1) / strides_spatial_shape[i])
 SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides_spatial_shape[i])</body></sourcecode>


<p id="_8e352277-22f4-844a-d306-71b29a5051ca">or when ceil_mode is disabled (<link target="https://www.tensorflow.org/api_docs/python/tf/keras/layers/AveragePooling2D):"/></p>

<sourcecode id="_2aa8ba24-fc84-b42d-f7e8-383c26b7b5f1" unnumbered="true"><body> VALID: output_spatial_shape[i] = floor((input_spatial_shape[i] - ((kernel_spatial_shape[i] - 1) * dilations[i] + 1)) / strides_spatial_shape[i]) + 1
 SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = floor((input_spatial_shape[i] - 1) / strides_spatial_shape[i]) + 1</body></sourcecode>


<p id="_3f37db8f-dce0-a184-73e1-40972c715c8c">And pad shape will be following if <tt>SAME_UPPER</tt> or <tt>SAME_LOWER</tt>:</p>

<sourcecode id="_893484e8-9219-8348-a7ae-cdb71ee4477f" unnumbered="true"><body> pad_shape[i] = (output_spatial_shape[i] - 1) * strides_spatial_shape[i] + ((kernel_spatial_shape[i] - 1) * dilations[i] + 1) - input_spatial_shape[i]</body></sourcecode>


<p id="_66835633-6bea-24c7-d5f0-02f29c4a145b">The output of each pooling window is divided by the number of elements (exclude pad when attribute count_include_pad is zero).</p>

<dl id="_8508f915-559b-d64a-f7fd-708797b086ee"><dt>Domain</dt>
<dd id="_3993d5cb-6d18-b56a-e265-20ecd10de175"><p id="_70103db5-e8c3-7e7a-e628-39fa13b1b835"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_624e0eef-197e-b94f-2fdf-0cba7a0d96d4"><p id="_ef57a1f9-8777-84e0-290a-170d0869547c">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_3d7b2640-e1b4-b0e1-7986-f6900f320829"><p id="_79f9753c-0a73-5d5d-9b61-f92033de3bb0">1, 7, 10, 11, 19</p>
</dd>
<dt>Inputs</dt>
<dd id="_05024c28-2d8f-fdd2-dfb7-f5c9990f65c1"><p id="_341dcb2a-2187-6d0c-0505-90448bb8355e"><tt>X (differentiable) : T</tt> — Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 …​ Dn), where N is the batch size. Optionally, if dimension denotation is in effect, the operation expects the input data tensor to arrive with the dimension denotation of [DATA_BATCH, DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE …​].</p>
</dd>
<dt>Outputs</dt>
<dd id="_b4e4f30a-59ef-6f36-5845-a031d75a5c3e"><p id="_d584b9ab-18c1-7020-14c2-c745363cb4f6"><tt>Y (differentiable) : T</tt> — Output data tensor from average or max pooling across the input tensor. Dimensions will vary based on various kernel, stride, and pad sizes. Floor value of the dimension is used</p>
</dd>
<dt>Attributes</dt>
<dd id="_b57018b8-b495-e81a-b935-d1180592e52c"><p id="_f25757be-251e-f146-2e2e-f2158ad2a545"><tt>auto_pad : string (default is NOTSET)</tt> — auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID. Where default value is NOTSET, which means explicit padding is used. SAME_UPPER or SAME_LOWER mean pad the input so that <tt>output_shape[i] = ceil(input_shape[i] / strides[i])</tt> for each axis <tt>i</tt>. The padding is split between the two sides equally or almost equally (depending on whether it is even or odd). In case the padding is an odd number, the extra padding is added at the end for SAME_UPPER and at the beginning for SAME_LOWER.<br/> <tt>ceil_mode : int (default is 0)</tt> — Whether to use ceil or floor (default) to compute the output shape.<br/> <tt>count_include_pad : int (default is 0)</tt> — Whether include pad pixels when calculating values for the edges. Default is 0, doesn’t count include pad.<br/> <tt>dilations : list of ints</tt> — Dilation value along each spatial axis of filter. If not present, the dilation defaults to 1 along each spatial axis.<br/> <tt>kernel_shape : list of ints (required)</tt> — The size of the kernel along each axis.<br/> <tt>pads : list of ints</tt> — Padding for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis. <tt>pads</tt> format should be as follow [x1_begin, x2_begin…​x1_end, x2_end,…​], where xi_begin the number of pixels added at the beginning of axis <tt>i</tt> and xi_end, the number of pixels added at the end of axis <tt>i</tt>. This attribute cannot be used simultaneously with auto_pad attribute. If not present, the padding defaults to 0 along start and end of each spatial axis.<br/> <tt>strides : list of ints</tt> — Stride along each spatial axis. If not present, the stride defaults to 1 along each spatial axis.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_c6e83adc-3940-b029-fbe6-6d64cf269f88"><p id="_7ed8e1a0-d677-0868-cfe2-46c3587d8da0"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_130e31df-5c9f-0807-fcc0-fe406e10afba"><p id="_9acf7ff1-a166-1805-cd49-a0d7200c2020"><tt>test_averagepool_1d_default</tt>, <tt>test_averagepool_2d_ceil</tt>, <tt>test_averagepool_2d_ceil_last_window_starts_on_pad</tt>, <tt>test_averagepool_2d_default</tt>, <tt>test_averagepool_2d_dilations</tt>, <tt>test_averagepool_2d_pads</tt>, <tt>test_averagepool_2d_pads_count_include_pad</tt>, <tt>test_averagepool_2d_precomputed_pads</tt>, <tt>test_averagepool_2d_precomputed_pads_count_include_pad</tt>, <tt>test_averagepool_2d_precomputed_same_upper</tt>, <tt>test_averagepool_2d_precomputed_strides</tt>, <tt>test_averagepool_2d_same_lower</tt>, <tt>test_averagepool_2d_same_upper</tt>, <tt>test_averagepool_2d_strides</tt>, <tt>test_averagepool_3d_default</tt>, <tt>test_averagepool_3d_dilations_small</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_c2a020d2-b4e4-2053-acd8-e477d26ce54b"><p id="_4f386db8-de4b-80b2-a975-a9485dda5311">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_acdd57c0-9ddb-39c7-22de-61d9f6a8b386" anchor="op-ai-onnx-default-batchnormalization" obligation="normative">
<title id="_038c3c8c-0025-64d0-8a19-03262a089aa0">BatchNormalization</title>
<p id="_646d45bb-478e-7129-bc71-f71ee36d6746">Carries out batch normalization as described in the paper <link target="https://arxiv.org/abs/1502.03167"/>. Depending on the mode it is being run, There are five required inputs ‘X’, ‘scale’, ‘B’, ‘input_mean’ and ‘input_var’. Note that ‘input_mean’ and ‘input_var’ are expected to be the estimated statistics in inference mode (training_mode=False, default), and the running statistics in training mode (training_mode=True). There are multiple cases for the number of outputs, which we list below:</p>

<ul id="_f68a3d7f-076b-e3a4-7dea-2f7cf22acd10"><li><p id="_afa84aa3-e040-cc99-84cb-999e49d032d1">Output case #1: Y, running_mean, running_var (training_mode=True)</p>
</li>
<li><p id="_6801d49e-fdeb-b6db-a70f-bf53d3d81518">Output case #2: Y (training_mode=False)</p>
</li>
</ul>

<p id="_f57a5197-aab3-ed18-61b6-3e8179621afd">When training_mode=False, extra outputs are invalid. The outputs are updated as follows when training_mode=True:</p>

<sourcecode id="_82671cef-578a-3f67-bfa0-8d63be715cf4" unnumbered="true"><body>running_mean = input_mean * momentum + current_mean * (1 - momentum)
running_var = input_var * momentum + current_var * (1 - momentum)

Y = (X - current_mean) / sqrt(current_var + epsilon) * scale + B</body></sourcecode>


<p id="_f54b356c-b789-190d-4731-d49416a3d5e0">where:</p>

<sourcecode id="_7184a768-7628-5471-d463-15f335cc08b6" unnumbered="true"><body>current_mean = ReduceMean(X, axis=all_except_channel_index)
current_var =  ReduceVar(X, axis=all_except_channel_index)</body></sourcecode>


<p id="_6bd36645-1a02-0a4b-b502-8d954af2a3c0">Notice that <tt>ReduceVar</tt> refers to the population variance, and it equals to <tt>sum(sqrd(x_i - x_avg)) / N</tt> where  <tt>N</tt> is the population size (this formula does not use sample size <tt>N - 1</tt>).</p>

<p id="_101207bb-7907-96ce-f61c-41882d2d72bc">The computation of ReduceMean and ReduceVar uses float to avoid overflow for float16 inputs.</p>

<p id="_a824c493-39a5-7ccd-8f29-cb0c7c77b2af">When training_mode=False:</p>

<sourcecode id="_cfa183bc-0de7-b1e0-222d-f5df83c29af5" unnumbered="true"><body>Y = (X - input_mean) / sqrt(input_var + epsilon) * scale + B</body></sourcecode>


<p id="_0a5325e2-04c2-f14a-398c-15531b23bb40">For previous (depreciated) non-spatial cases, implementors are suggested to flatten the input shape to (N x C * D1 * D2 * …​ * Dn) before a BatchNormalization Op. This operator has  <strong>optional</strong> inputs/outputs. See the doc for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument’s name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.</p>

<dl id="_e245cda2-6544-036f-3e80-4c5485b33c56"><dt>Domain</dt>
<dd id="_107aa6b5-73c2-e11c-5885-12ed9f7ea039"><p id="_6bd29727-a2e3-d2c7-f2be-9ab0c66d13ad"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_58f2c5b5-8f20-5f68-3fa9-32a04fb66749"><p id="_d08d6ae9-0716-b546-f19d-1ba77940005e">15</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_fa568f31-b131-2d28-c5d8-f28808647553"><p id="_f8f1644e-5385-dde5-d4f8-eb9dd75ec949">1, 6, 7, 9, 14</p>
</dd>
<dt>Inputs</dt>
<dd id="_7c0ed15b-7fdd-e4b7-554c-4bc4db9e4d45"><p id="_5dc5025b-b595-157c-68b0-5c91c019c51c"><tt>X (differentiable) : T</tt> — Input data tensor from the previous operator; dimensions are in the form of (N x C x D1 x D2 …​ Dn), where N is the batch size, C is the number of channels. Statistics are computed for every channel of C over N and D1 to Dn dimensions. For image data, input dimensions become (N x C x H x W). The op also accepts single dimension input of size N in which case C is assumed to be 1<br/> <tt>scale (differentiable) : T1</tt> — Scale tensor of shape ©.<br/> <tt>B (differentiable) : T1</tt> — Bias tensor of shape ©.<br/> <tt>input_mean (differentiable) : T2</tt> — running (training) or estimated (testing) mean tensor of shape ©.<br/> <tt>input_var (differentiable) : T2</tt> — running (training) or estimated (testing) variance tensor of shape ©.</p>
</dd>
<dt>Outputs (1 — 3)</dt>
<dd id="_1982f251-c05c-38b7-2418-cf470670cde0"><p id="_541a8ede-bcb1-19b5-8b6f-c5fbeb8627d5"><tt>Y (differentiable) : T</tt> — The output tensor of the same shape as X<br/> <tt>running_mean (optional, non-differentiable) : T2</tt> — The running mean after the BatchNormalization operator.<br/> <tt>running_var (optional, non-differentiable) : T2</tt> — The running variance after the BatchNormalization operator. This op uses the population size (N) for calculating variance, and not the sample size N-1.</p>
</dd>
<dt>Attributes</dt>
<dd id="_2a71ed00-e58a-0df4-3ec8-1b06823697b1"><p id="_5c30b1f8-4c8f-3ef9-c271-40d56ce0b4ae"><tt>epsilon : float (default is 1e-05)</tt> — The epsilon value to use to avoid division by zero.<br/> <tt>momentum : float (default is 0.9)</tt> — Factor used in computing the running mean and variance.e.g., running_mean = running_mean * momentum + mean * (1 — momentum).<br/> <tt>training_mode : int (default is 0)</tt> — If set to true, it indicates BatchNormalization is being used for training, and outputs 1 and 2 are to be computed.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_20d83a92-b785-1771-655c-bf0e8b10fa2b"><p id="_73862daf-da1d-dca4-f700-18a916c119f4"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.<br/> <tt>T1 : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain scale and bias types to float tensors.<br/> <tt>T2 : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain mean and variance types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_de6697c1-e707-7abc-1a64-d13727076913"><p id="_659030bf-a3db-d5ea-f724-90efd377b8fd"><tt>test_batchnorm_example</tt>, <tt>test_batchnorm_epsilon</tt>, <tt>test_batchnorm_example_training_mode</tt>, <tt>test_batchnorm_epsilon_training_mode</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_1259b68d-22d4-0c43-2379-4f0a64049eac"><p id="_1d0de3a2-54ae-5a2d-6025-59cea629d559">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_859b6abe-cc20-dcba-7c5e-6d2513de8637" anchor="op-ai-onnx-default-bernoulli" obligation="normative">
<title id="_6e5df7d9-8fae-008b-c07c-8c7fa497cb7f">Bernoulli</title>
<p id="_6a9664c0-27c2-cc10-496c-b457a2cfdf18">Draws binary random numbers (0 or 1) from a Bernoulli distribution. The input tensor should be a tensor containing probabilities p (a value in the range [0,1]) to be used for drawing the binary random number, where an output of 1 is produced with probability p and an output of 0 is produced with probability (1-p).</p>

<p id="_73b70417-2461-461b-fd44-6987712c3fb5">This operator is non-deterministic and may not produce the same values in different implementations (even if a seed is specified).</p>

<dl id="_1dc5e9fb-8680-17f5-2bf1-9e4bc21b5a57"><dt>Domain</dt>
<dd id="_2c29da66-b66b-e1d4-727b-65ea7c006170"><p id="_d700bb35-7391-286c-fdc7-24cd261084ec"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_7c036c53-3155-d88d-7b0e-3cf72836d1da"><p id="_b329d517-50cd-d4df-f4e4-044d50491ce1">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_d65f8b4f-e4c1-1b49-fe50-2814c46d8372"><p id="_b6c0006a-ca27-3169-16f6-70903dbffd13">15</p>
</dd>
<dt>Inputs</dt>
<dd id="_b54c7d4e-52f4-5244-e409-65379063ad8e"><p id="_af4dbc23-cbca-8ef0-0e61-60b387a07f3a"><tt>input : T1</tt> — All values in input have to be in the range:[0, 1].</p>
</dd>
<dt>Outputs</dt>
<dd id="_9e0f6fdb-0328-e56a-65ba-c21288634643"><p id="_4a54d5a7-9fdf-4eb9-84aa-5220c12ff022"><tt>output : T2</tt> — The returned output tensor only has values 0 or 1, same shape as input tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_a7321020-74cb-d722-256a-4dc8375d3a69"><p id="_1c74cf90-bbc9-6324-bfb6-60f395e300b1"><tt>dtype : int</tt> — The data type for the elements of the output tensor. if not specified, we will use the data type of the input tensor.<br/> <tt>seed : float</tt> — (Optional) Seed to the random generator, if not specified we will auto generate one.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_3be715cc-8141-cc5d-ce89-ef0a29320b16"><p id="_c397547c-2be3-3a57-992d-1c1ebf8e2f69"><tt>T1 : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input types to float tensors.<br/> <tt>T2 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(bool)</tt> — Constrain output types to all numeric tensors and bool tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_4719e811-e371-7d00-449c-2fb96bb49b4e"><p id="_a28d51a8-601b-c5d3-271e-9a7e7b196405"><tt>test_bernoulli_double</tt>, <tt>test_bernoulli_seed</tt>, <tt>test_bernoulli</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_42ce9892-0b88-b0a1-4180-d1f52e4cea34"><p id="_daa0fd70-2bc2-8183-abee-6afcb4cd9217">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_f6552409-2917-f6ab-be54-4d2373b51f2b" anchor="op-ai-onnx-default-bitcast" obligation="normative">
<title id="_46ca2390-3d30-d8ce-c102-d30d4a721740">BitCast</title>
<p id="_e755a197-1958-5fed-a432-71a0d9fd1c54">Reinterprets the binary representation of a tensor as a different data type, specified by the ‘to’ attribute. Unlike Cast, BitCast preserves the exact bit pattern without any value conversion.</p>

<p id="_0ec62546-913f-dff3-770b-d94412fa2a70">The target data type must have the same bit-width as the input data type. The output tensor has the same shape as the input tensor. All types except string are supported. Implementations must treat the underlying bytes as little endian.</p>

<dl id="_cfcfe118-17db-d648-7720-cccb68be9e8b"><dt>Domain</dt>
<dd id="_6bb2be7b-15c8-60ec-14e5-f233ffe7840f"><p id="_f1b5cef5-fd3c-5979-3dd7-e0214066bc5d"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_e62e2950-9f77-f9c9-ad13-40b946d63ef3"><p id="_deabc942-0a44-94b7-b200-0196dd6b9e01">26</p>
</dd>
<dt>Inputs</dt>
<dd id="_78ee45ec-7871-585d-83bf-1246bc105a4c"><p id="_16a54ad2-e099-f3b7-12f4-08c7130d1191"><tt>input (non-differentiable) : T1</tt> — Input tensor to be bitcast.</p>
</dd>
<dt>Outputs</dt>
<dd id="_2f13a822-f26e-bf3a-2626-b06dde4e7201"><p id="_559426d6-d72f-fe9c-4324-086e4ce225d2"><tt>output (non-differentiable) : T2</tt> — Output tensor with the same shape as the input.</p>
</dd>
<dt>Attributes</dt>
<dd id="_1bb2db0c-6533-922d-260e-b9df0e73d3b8"><p id="_1645c137-fef9-ff10-4f3c-6fb4ceaeca55"><tt>to : int (required)</tt> — The data type to which the input tensor is bitwise reinterpreted. Must be one of the non-string types from DataType enum in TensorProto. The target type must have the same bit-width as the input type.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_de216ae4-5935-3351-2286-0dc6d04106aa"><p id="_8dd3bac4-0b46-6253-00cd-5f1c7f0fe8b6"><tt>T1 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2)</tt> — Constrain input types. Bitcasting from string is not supported.<br/> <tt>T2 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2)</tt> — Constrain output types. Bitcasting to string is not supported.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_0d5dc9c1-d161-31a2-f839-6faf18a72215"><p id="_2b646b85-f34a-d5b6-7e29-6f1b587951a9"><tt>test_bitcast_2d_float32_to_int32</tt>, <tt>test_bitcast_bool_to_uint8</tt>, <tt>test_bitcast_float32_to_int32</tt>, <tt>test_bitcast_float64_to_int64</tt>, <tt>test_bitcast_int32_to_float32</tt>, <tt>test_bitcast_int64_to_float64</tt>, <tt>test_bitcast_int8_to_uint8</tt>, <tt>test_bitcast_scalar_float32_to_int32</tt>, <tt>test_bitcast_uint16_to_int16</tt>, <tt>test_bitcast_uint32_to_int32</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_c127d7b6-605c-d53f-fafd-e8cbbf53d9f1"><p id="_0b642af5-0b5c-222a-47b5-5a3050451422">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_6c13147b-c9f2-55c9-0154-db4f5b03fc63" anchor="op-ai-onnx-default-bitshift" obligation="normative">
<title id="_4b08a3f5-3625-fe62-c91f-c0ac4601fe3c">BitShift</title>
<p id="_707a60f6-0f24-81de-1d39-5150fd405881">Bitwise shift operator performs element-wise operation. For each input element, if the attribute “direction” is “RIGHT”, this operator moves its binary representation toward the right side. If the attribute “direction” is “LEFT”, bits of binary representation move toward the left side. The input X is the tensor to be shifted and another input Y specifies the amounts of shifting. For example, if “direction” is “RIGHT”, X is [1, 4], and Y is [1, 1], the corresponding output Z would be [0, 2]. If “direction” is “LEFT” with X=[1, 2] and Y=[1, 2], the corresponding output Z would be [2, 8].</p>

<p id="_3ba52d9d-daa1-028e-f67c-2fb6e858eb45">For a signed T the right shift is an arithmetic shift (sign-extending). The vacated high bits are filled with copies of the sign bit, so a negative X stays negative. For a signed T a left shift can move bits into and past the sign bit, and bits shifted past the sign bit are discarded.</p>

<p id="_3547532e-b5cb-d314-ca95-89c786282422">If Y is negative, or is greater than or equal to the number of bits of T, then the result is whatever the sign bit extension alone produces: -1 for a right shift on a negative X, where the fill is a sign bit of 1, and 0 in every other case. This operator supports  <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_a3c5291f-34b2-d174-0d3e-c3700363241c"><dt>Domain</dt>
<dd id="_be66a0ce-1c8c-8de9-09e9-89e603c00612"><p id="_0d5e10d4-d879-ef0d-a0c5-fa80da7529a9"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_2f2c8134-f475-2141-0c9f-8d28489286cf"><p id="_2b1fd3f0-d7c6-f482-17d8-337196250876">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_1ba19b02-6d04-8400-d008-a4b148ba3f46"><p id="_e20fe4e5-084e-2c3b-2c9e-ef1cee204261">11</p>
</dd>
<dt>Inputs</dt>
<dd id="_635fbba4-0446-acca-097f-f2ab3362228f"><p id="_bf15d9a0-0690-4264-8ac7-b5a5095b8f69"><tt>X (non-differentiable) : T</tt> — First operand, input to be shifted.<br/> <tt>Y (non-differentiable) : T</tt> — Second operand, amounts of shift.</p>
</dd>
<dt>Outputs</dt>
<dd id="_543cf877-fcc2-aa52-39bd-9898054bff0a"><p id="_2d8177fe-d763-1da7-e194-16bf9938a8c2"><tt>Z (non-differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_e90bf171-e2aa-248b-0131-a4de10daed6f"><p id="_d3cfe01f-3ddc-7545-d6b4-34455d72b74c"><tt>direction : string (required)</tt> — Direction of moving bits. It can be either “RIGHT” (for right shift) or “LEFT” (for left shift).</p>
</dd>
<dt>Type constraints</dt>
<dd id="_a1c5ffe6-8951-ae20-911e-06d3580a1d83"><p id="_cdb00a4c-e411-134c-fc3d-5881c5d0071d"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64)</tt> — Constrain input and output types to integer tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_fbab78a5-e95c-c310-04cb-1ab6110e00bd"><p id="_32d2ef8b-f888-3263-6ed8-cd6d73c336bc"><tt>test_bitshift_left_int16</tt>, <tt>test_bitshift_left_int32</tt>, <tt>test_bitshift_left_int32_negative_shift</tt>, <tt>test_bitshift_left_int32_overflow</tt>, <tt>test_bitshift_left_int32_shift_ge_width</tt>, <tt>test_bitshift_left_int64</tt>, <tt>test_bitshift_left_int8</tt>, <tt>test_bitshift_left_int8_negative_shift</tt>, <tt>test_bitshift_left_int8_overflow</tt>, <tt>test_bitshift_left_int8_shift_ge_width</tt>, <tt>test_bitshift_left_uint16</tt>, <tt>test_bitshift_left_uint32</tt>, <tt>test_bitshift_left_uint64</tt>, <tt>test_bitshift_left_uint8</tt>, <tt>test_bitshift_right_int16</tt>, <tt>test_bitshift_right_int32</tt>, <tt>test_bitshift_right_int32_negative_input</tt>, <tt>test_bitshift_right_int32_negative_shift</tt>, <tt>test_bitshift_right_int32_shift_ge_width</tt>, <tt>test_bitshift_right_int64</tt>, <tt>test_bitshift_right_int8</tt>, <tt>test_bitshift_right_int8_negative_input</tt>, <tt>test_bitshift_right_int8_negative_shift</tt>, <tt>test_bitshift_right_int8_shift_ge_width</tt>, <tt>test_bitshift_right_uint16</tt>, <tt>test_bitshift_right_uint32</tt>, <tt>test_bitshift_right_uint64</tt>, <tt>test_bitshift_right_uint8</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_ddec5ff3-8466-ed3e-9ae8-ef7739fb2ec1"><p id="_c0f05d56-89c1-7c92-339c-4af3ac2be69d">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_e27448f2-8852-b8bc-a23c-fa0a1697ebd8" anchor="op-ai-onnx-default-bitwiseand" obligation="normative">
<title id="_b68e2948-b547-88f0-0820-5700e165bacc">BitwiseAnd</title>
<p id="_90b76632-ba36-0f24-b555-6521fd5705f6">Returns the tensor resulting from performing the bitwise <tt>and</tt> operation elementwise on the input tensors  <tt>A</tt> and <tt>B</tt> (with Numpy-style broadcasting support).</p>

<p id="_b50403c8-20f6-5d06-93cd-097c9f5c50c0">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_77bbec62-7e56-3a97-57b6-d13348271103"><dt>Domain</dt>
<dd id="_9fd9c89d-23db-5704-e083-d88f485933a5"><p id="_bb9289fe-98c4-e472-27d6-f766ef0c8ea8"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_dad72175-9365-fef4-e28d-ab44405004ef"><p id="_94ec04bf-c0ab-94ca-da02-bbe6ac0fb276">18</p>
</dd>
<dt>Inputs</dt>
<dd id="_a268234a-74b2-0391-7296-6ced2857ad78"><p id="_80839bd0-d54f-2a2b-1f02-8c6f369565a7"><tt>A (non-differentiable) : T</tt> — First input operand for the bitwise operator.<br/> <tt>B (non-differentiable) : T</tt> — Second input operand for the bitwise operator.</p>
</dd>
<dt>Outputs</dt>
<dd id="_c3b90bd8-6f80-25f4-2f00-364ef5660bda"><p id="_3ffe7eb0-0d3a-38df-b088-e5d83f5773b8"><tt>C (non-differentiable) : T</tt> — Result tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_2c733700-3eba-ca70-1841-08c932cf5fa2"><p id="_67b741c1-3407-a020-cc24-164f6c9b0ed3">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_56f1ba04-3eeb-90df-1e8a-bb5a2deea6f2"><p id="_332931a4-af3d-fa81-cff2-7f9a539a9943"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64)</tt> — Constrain input to integer tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_1271ec4e-7235-976f-9386-3f30acb0ff75"><p id="_6c87c4ea-c69c-f886-82f6-797ade97c176"><tt>test_bitwise_and_i32_2d</tt>, <tt>test_bitwise_and_i16_3d</tt>, <tt>test_bitwise_and_ui64_bcast_3v1d</tt>, <tt>test_bitwise_and_ui8_bcast_4v3d</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_7efab0f0-f847-eb9c-40ad-89f140575ba0"><p id="_112e4a04-667e-0206-bb63-8984f788bed1">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_182f114f-f612-bd8a-fc39-982fdc27e98f" anchor="op-ai-onnx-default-bitwisenot" obligation="normative">
<title id="_fc9275b8-4fb2-442b-206d-151a403b0972">BitwiseNot</title>
<p id="_e9b2cf92-4fb5-96a6-b75a-77c3cf364192">Returns the bitwise not of the input tensor element-wise.</p>

<dl id="_2f4fe3ad-040d-27fc-52b5-78a139909811"><dt>Domain</dt>
<dd id="_211c0843-32b6-ea5e-2256-b7f482716188"><p id="_7cea2fec-3913-7e36-be76-7b860e463862"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_573c5cf6-dbab-b3c0-933c-bc041c2ce8d4"><p id="_b432afaf-4cdb-3418-f192-9d67c775edce">18</p>
</dd>
<dt>Inputs</dt>
<dd id="_cc05ebeb-35ed-92a5-91de-02ffb7988352"><p id="_e3eafbf3-b27e-cbe5-08f3-c8076f6a4568"><tt>X (non-differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_43434e76-b029-a197-c73d-4bc22da6d6c3"><p id="_6a69f58e-ebce-b9ac-2177-5f2dce4273aa"><tt>Y (non-differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_157c4248-5041-4719-8315-dd400e4d06db"><p id="_3ec6af05-a276-2ea5-f35c-cc71e870dc04">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_eae45131-f4e8-1763-eb28-b2c079ae293e"><p id="_e1c6d5ea-484b-ff61-d9b3-38a33a11a661"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64)</tt> — Constrain input/output to integer tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_0b9cd976-1fca-01c4-a0fe-36bf67606e9c"><p id="_97020dcb-e894-7443-055f-f91bc0e4106b"><tt>test_bitwise_not_2d</tt>, <tt>test_bitwise_not_3d</tt>, <tt>test_bitwise_not_4d</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_5ab86b02-3a64-60ca-83cf-7700b8c79af8"><p id="_82e0e1d9-ca25-f2a1-90d3-733477d92d1a">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_6e650ae2-ca3e-8695-6b72-98167cc48260" anchor="op-ai-onnx-default-bitwiseor" obligation="normative">
<title id="_beff53f8-7da3-ad59-7994-b2366bd094f5">BitwiseOr</title>
<p id="_332ca46a-b574-59fa-e1f4-ea34dc374f19">Returns the tensor resulting from performing the bitwise <tt>or</tt> operation elementwise on the input tensors  <tt>A</tt> and <tt>B</tt> (with Numpy-style broadcasting support).</p>

<p id="_46b3e0dd-babb-ac37-8142-743e56474fb6">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_ca871a58-383d-1721-bf98-db50b152960b"><dt>Domain</dt>
<dd id="_a682f455-a3d5-2055-8661-e5640c652d7c"><p id="_896698cf-324c-b797-6a9a-881ab6e02e89"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_0a047acf-1b48-71dc-c629-d932d8a98248"><p id="_87cb1ee7-dab3-ebdb-387f-06dc71a18fd7">18</p>
</dd>
<dt>Inputs</dt>
<dd id="_2511417b-6f89-7f78-da93-47de737da2b8"><p id="_8228b3ec-7b76-6975-65d0-e176ab2a04e0"><tt>A (non-differentiable) : T</tt> — First input operand for the bitwise operator.<br/> <tt>B (non-differentiable) : T</tt> — Second input operand for the bitwise operator.</p>
</dd>
<dt>Outputs</dt>
<dd id="_bb8bdeb4-eff8-210b-7d1e-95ddedb35c9b"><p id="_3412e3f9-c129-9160-ba1c-7918234c08b0"><tt>C (non-differentiable) : T</tt> — Result tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_c98751c0-74ba-c564-2139-4fb2368679a4"><p id="_8181c6ef-bfc6-3168-a6fd-bb97a9f5ada8">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_52210fd2-9e4b-a2d3-8c65-dae552b65723"><p id="_911e74df-37a4-ea4d-d486-cee19c02ec0c"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64)</tt> — Constrain input to integer tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_4ceabfd4-b9b4-7bbf-573d-068708eaa576"><p id="_df17d8a2-c124-bf5b-e159-d45b3d79c71f"><tt>test_bitwise_or_i32_2d</tt>, <tt>test_bitwise_or_i16_4d</tt>, <tt>test_bitwise_or_ui64_bcast_3v1d</tt>, <tt>test_bitwise_or_ui8_bcast_4v3d</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_1b5412a7-f265-28a0-5d6c-b120ba58ae4d"><p id="_eddf1c62-38e4-ee0e-35a6-42751f0b990e">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_a88dc97c-6b91-8548-01a5-d5a7343b99c8" anchor="op-ai-onnx-default-bitwisexor" obligation="normative">
<title id="_1f289b0d-41ae-74f0-15ba-867affcf8737">BitwiseXor</title>
<p id="_97e58304-3268-83d1-5513-1eebeded18f7">Returns the tensor resulting from performing the bitwise <tt>xor</tt> operation elementwise on the input tensors  <tt>A</tt> and <tt>B</tt> (with Numpy-style broadcasting support).</p>

<p id="_683c21a0-4b8e-62ba-a43b-9c22aec5aab3">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_770078e4-dcfc-54c2-ba47-f6cbb78070f5"><dt>Domain</dt>
<dd id="_cb1b9bfa-244b-d6fe-ca46-92ee7ba67483"><p id="_683f61b5-6a26-26eb-bdc7-bc3803386e5e"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_904acfef-e17a-8431-6f35-d05ff98ce781"><p id="_f1e15d83-3e62-8f98-3ae9-b450f69ff265">18</p>
</dd>
<dt>Inputs</dt>
<dd id="_abd1a07c-76a8-0959-6b7b-5eec86b04531"><p id="_705cb005-93f0-f1f4-519a-a152cfe75eab"><tt>A (non-differentiable) : T</tt> — First input operand for the bitwise operator.<br/> <tt>B (non-differentiable) : T</tt> — Second input operand for the bitwise operator.</p>
</dd>
<dt>Outputs</dt>
<dd id="_d43ebfc7-7eb9-6416-8497-0ba48fe93100"><p id="_04fa889d-652b-8083-5001-0e0c10192bec"><tt>C (non-differentiable) : T</tt> — Result tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_7814c454-ae05-dec1-6c67-448b43f9cb4c"><p id="_85beb24f-0f29-bc5d-37fa-953b98cc68b2">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_bc5f5760-6044-a10a-fd4e-9c9d870e7831"><p id="_5b9b88c5-4196-a5f2-9419-06ba83fae7ea"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64)</tt> — Constrain input to integer tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_756a412f-d654-0901-693a-caa996e59235"><p id="_8bcd1e4b-9cca-7723-41e2-2962a25cf7d8"><tt>test_bitwise_xor_ui64_bcast_3v1d</tt>, <tt>test_bitwise_xor_ui8_bcast_4v3d</tt>, <tt>test_bitwise_xor_i32_2d</tt>, <tt>test_bitwise_xor_i16_3d</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_a65053f9-6dbb-272e-1dda-6cfb328bd92c"><p id="_0983e369-eb4a-90a8-52ae-07ebfa104d9c">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_368781aa-57e9-aac5-0956-bbb78f0e2627" anchor="op-ai-onnx-default-blackmanwindow" obligation="normative">
<title id="_19af5a36-d784-4564-23a7-e4946c68e2f2">BlackmanWindow</title>
<p id="_54162cac-b4a1-74e7-d9de-4b12e9db612d">Generates a Blackman window as described in the paper <link target="https://ieeexplore.ieee.org/document/1455106"/>.</p>

<dl id="_3af59f33-64ea-f97a-6a2f-154cf90d01d6"><dt>Domain</dt>
<dd id="_0b2ed034-4c30-8489-b1c0-b1577435c337"><p id="_ae7038df-9ed4-23ce-b1a1-5edddd1c1bee"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_bcbccab8-905c-9854-8626-265ea02c9db8"><p id="_a4524c7b-2b15-9f66-bfc7-9c16bd0cf31a">17</p>
</dd>
<dt>Inputs</dt>
<dd id="_dfe1e7fd-48ab-0cb8-6574-ba1447c2c814"><p id="_65a69acb-382e-144d-8355-33a410f1dbf2"><tt>size (non-differentiable) : T1</tt> — A scalar value indicating the length of the window.</p>
</dd>
<dt>Outputs</dt>
<dd id="_197a97ec-a547-42dc-def8-c3ec3bc14f0b"><p id="_dc541aae-6538-1fc3-13fc-786c185382d0"><tt>output (non-differentiable) : T2</tt> — A Blackman window with length: size. The output has the shape: [size].</p>
</dd>
<dt>Attributes</dt>
<dd id="_049c321a-adbb-d909-ceeb-ce50e1c7cd3a"><p id="_a8bf137c-cd56-2df6-8006-9fdfa541ba0d"><tt>output_datatype : int (default is 1)</tt> — The data type of the output tensor. Strictly must be one of the values from DataType enum in TensorProto whose values correspond to T2. The default value is 1 = FLOAT.<br/> <tt>periodic : int (default is 1)</tt> — If 1, returns a window to be used as periodic function. If 0, return a symmetric window. When ‘periodic’ is specified, hann computes a window of length size + 1 and returns the first size points. The default value is 1.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_997aee1e-f55a-41d7-1804-e0549aab3837"><p id="_e9e92d30-e3ce-acbe-17bd-1e019bca14b8"><tt>T1 : tensor(int32), tensor(int64)</tt> — Constrain the input size to int32_t or int64_t.<br/> <tt>T2 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain output types to numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_b1bac722-a390-9b35-68d2-5b438a214360"><p id="_6c9b0dff-3dfe-84f0-fddf-2d17b9646a4f"><tt>test_blackmanwindow</tt>, <tt>test_blackmanwindow_symmetric</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_27c922c0-54e0-25d0-fa86-e72bb07e3cb7"><p id="_c15ff7ee-271c-0a1b-d55e-d9e1129a9a1f">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_e24047be-bacd-67b4-95ae-59785812397e" anchor="op-ai-onnx-default-cast" obligation="normative">
<title id="_d5d23110-97c2-05cb-1133-c94b37b23eab">Cast</title>
<p id="_a5704c32-66eb-5781-9e6f-580527709203">The operator casts the elements of a given input tensor to a data type specified by the ‘to’ argument and returns an output tensor of the same size in the converted type. The ‘to’ argument must be one of the data types specified in the ‘DataType’ enum field in the TensorProto message.</p>

<p id="_a25482a4-501d-0813-b6d4-1e7d084c1fcd">Casting from string tensor in plain (e.g., “3.14” and “1000”) and scientific numeric representations (e.g., “1e-5” and “1E8”) to float types is supported. For example, converting string “100.5” to an integer may yield result 100. There are some string literals reserved for special floating-point values; “+INF” (and “INF”), “-INF”, and “NaN” are positive infinity, negative infinity, and not-a-number, respectively. Any string which can exactly match “+INF” in a case-insensitive way would be mapped to positive infinite. Similarly, this case-insensitive rule is applied to “INF” and “NaN”. When casting from numeric tensors to string tensors, plain floating-point representation (such as “314.15926”) would be used. Converting non-numerical-literal string such as “Hello World!” is an undefined behavior. Cases of converting string representing floating-point arithmetic value, such as “2.718”, to INT is an undefined behavior.</p>

<p id="_3ff26942-b5fc-bf54-211a-6420efd99926">Conversion from a numerical type to any numerical type is always allowed. User must be aware of precision loss and value change caused by range difference between two types. For example, a 64-bit float 3.1415926459 may be round to a 32-bit float 3.141592. Similarly, converting an integer 36 to Boolean may produce 1 because we truncate bits which can’t be stored in the targeted type.</p>

<p id="_aa72da2f-d122-a496-eb33-7a41f2e6ddee">In more detail, the conversion among numerical types should follow these rules if the destination type is not a float 8 type.</p>

<ul id="_50738755-2308-d620-e390-7e1b7ceb0b73"><li><p id="_c33624da-08a6-a95f-a495-2e33e0fd2c99">Casting from floating point to:</p>
<ul id="_3846696e-0716-9a53-f70c-dde7af4aa944"><li><p id="_3070a0a4-f8ac-acc8-9f1e-c95840ee304f">floating point: +/- infinity if OOR (out of range).</p>
</li>
<li><p id="_377adb5a-3058-5f48-c8a0-e197ea0b7624">fixed point: undefined if OOR.</p>
</li>
<li><p id="_3fbb02ba-418e-f96d-a632-bc251194eaae">bool: +/- 0.0 to False; all else to True.</p>
</li>
</ul>
</li>
<li><p id="_6346221d-63d3-bc03-dd44-67959aceacd9">Casting from fixed point to:</p>
<ul id="_83636b85-f3f4-6b68-4b6e-c947bed86c36"><li><p id="_e8a221dc-dfac-d204-bc57-9fbcc62d14bc">floating point: /- infinity if OOR. ( infinity in the case of uint)</p>
</li>
<li><p id="_05885da9-bfb6-6787-3233-1f16b4a297b4">fixed point: when OOR, discard higher bits and reinterpret (with respect to two’s complement representation for signed types). For example, 200 (int16) -&gt; -56 (int8).</p>
</li>
<li><p id="_4f14bbe0-63d3-8284-f6fd-323dacaa877c">bool: zero to False; nonzero to True.</p>
</li>
</ul>
</li>
<li><p id="_ee69d41f-6c7b-e102-ada1-6bb47e7bb92c">Casting from bool to:</p>
<ul id="_442334bc-b204-bc9e-5f68-86afa16215ea"><li><p id="_ad17ae37-a9a9-ee83-ff6e-96d2debc6e61">floating point: <tt>{1.0, 0.0}</tt>.</p>
</li>
<li><p id="_75f81881-7ce9-ccf0-3518-2eae00fcfcb9">fixed point: <tt>{1, 0}</tt>.</p>
</li>
<li><p id="_ba073280-49e6-920a-91f9-0b2d759d18d9">bool: no change.</p>
</li>
</ul>
</li>
</ul>

<p id="_bd56a15a-f564-77b4-fdca-d9142800cf65">Float 8 types (E4M3FN, E4M3FNUZ, E5M2, E5M2FNUZ) were introduced to speed up the training of deep models. By default the conversion of a float  <em>x</em> obeys to the following rules.  <tt>[x]</tt> means the value rounded to the target mantissa width.</p>

<table id="_440c25cd-8c2b-4f31-2710-54d636183c00">
<name id="_e51a9e37-0517-4c40-fb83-a9fcbbce3ab6">Table from the upstream description of <tt>Cast</tt></name>
<thead><tr id="_69486c44-893f-d8eb-c728-0abcef80dbfb"><th id="_d414b3d3-7e96-17e1-fa3b-a5238401bc45" valign="top" align="left">x</th>
<th id="_834b8188-e65f-b878-dc78-ec003f54041e" valign="top" align="left">E4M3FN</th>
<th id="_6267d66e-73db-6ae2-ff2f-5aa9c6534653" valign="top" align="left">E4M3FNUZ</th>
<th id="_ebf5ddf4-2543-94f2-8680-a52d51f82519" valign="top" align="left">E5M2</th>
<th id="_833d93f2-f347-14fd-76eb-f5aad4876438" valign="top" align="left">E5M2FNUZ</th>
</tr></thead>
<tbody><tr id="_5d37e8c9-1bec-d8ef-bb6b-4ebd48dfd9c9"><td id="_87e8dd88-fa48-1505-4e1d-4602f6446cba" valign="top" align="left">0</td>
<td id="_fa1e96f1-7472-8032-227f-dda5b550b553" valign="top" align="left">0</td>
<td id="_96b145be-7bb2-0c66-0f5e-de6b771bc109" valign="top" align="left">0</td>
<td id="_66e70458-3a53-11d7-96c0-212848de8996" valign="top" align="left">0</td>
<td id="_66ec1f59-e7a4-3f51-3663-58ff7a03134f" valign="top" align="left">0</td>
</tr><tr id="_c007f33b-5b46-a3ba-f8db-4b7610bed530"><td id="_5bee2052-2c4c-75cf-cb28-6695b0402767" valign="top" align="left">-0</td>
<td id="_305dcba6-dc45-0505-875b-e3609836b557" valign="top" align="left">-0</td>
<td id="_a1eaa4f3-2020-c495-b223-4edc0c1b1509" valign="top" align="left">0</td>
<td id="_351885f1-a692-bc35-5d25-b0c2dafd9964" valign="top" align="left">-0</td>
<td id="_fccb0944-30ed-3a39-99e6-859057646201" valign="top" align="left">0</td>
</tr><tr id="_53c307f8-834b-d2f3-45f4-c15addfba70a"><td id="_ab7c8591-b608-d16f-baf0-ccf70def5405" valign="top" align="left">NaN</td>
<td id="_ee2ca1bb-808b-55e4-dca0-21c291de6277" valign="top" align="left">NaN</td>
<td id="_6eb34ce0-40d3-3cd2-bde2-08d83b7fb87a" valign="top" align="left">NaN</td>
<td id="_1827a82e-7045-a7ef-8ad9-6518cfb56017" valign="top" align="left">NaN</td>
<td id="_302d1957-63d3-0ad7-53a7-2e82d1bf2ee7" valign="top" align="left">NaN</td>
</tr><tr id="_ee674b24-f997-43df-93d2-f0b20b135071"><td id="_14b4debb-e5b5-dd78-c7f2-419b8b3b3a75" valign="top" align="left">Inf</td>
<td id="_2f4091c4-a0ea-2730-5956-0a4c8742e14d" valign="top" align="left">FLT_MAX</td>
<td id="_8f51d066-7747-1efc-08cc-86f94ac3d201" valign="top" align="left">FLT_MAX</td>
<td id="_1e2ce537-7083-4282-270e-606ea3f09ebd" valign="top" align="left">FLT_MAX</td>
<td id="_f15a59f9-f7d5-af23-05af-f6cb5de1e9b2" valign="top" align="left">FLT_MAX</td>
</tr><tr id="_0f7b368a-3aea-55b4-83eb-116a1857e725"><td id="_8e438d90-6584-87aa-0ec2-6bd60b03ac47" valign="top" align="left">-Inf</td>
<td id="_fc05528f-1e44-7561-58c4-77990aec1bca" valign="top" align="left">-FLT_MAX</td>
<td id="_0c92bbb5-98a2-9bb2-712e-b948d687bb0d" valign="top" align="left">-FLT_MAX</td>
<td id="_bb4c4b50-36fd-dc48-dad2-bb3e480f52f9" valign="top" align="left">-FLT_MAX</td>
<td id="_6f1ddf00-64a6-88f6-88a8-fec70010b11b" valign="top" align="left">-FLT_MAX</td>
</tr><tr id="_73e9b991-3187-a7a3-d18b-6fc593f0fe4a"><td id="_c728d85f-e5f9-2a1f-1057-e02e71ba75ad" valign="top" align="left">[x] &gt; FLT_MAX</td>
<td id="_81d8276f-da7c-f6d9-a033-18402231e4a1" valign="top" align="left">FLT_MAX</td>
<td id="_dd02fba4-4495-a06a-b0d3-060bd7ca8b3a" valign="top" align="left">FLT_MAX</td>
<td id="_614daff9-56d8-4072-db9c-5176be5cdf49" valign="top" align="left">FLT_MAX</td>
<td id="_b22769f4-ac72-de6c-7c53-f5e9722028b0" valign="top" align="left">FLT_MAX</td>
</tr><tr id="_c083a130-b032-2bd3-6709-9eccb8e54479"><td id="_4a7ad3f0-fee2-d0b8-b077-c61a0e7f50a0" valign="top" align="left">[x] &lt; -FLT_MAX</td>
<td id="_93784e3b-704c-2a71-10b6-d180492ce89c" valign="top" align="left">-FLT_MAX</td>
<td id="_43385f6b-e537-2ba9-7b63-dc38315ef3c7" valign="top" align="left">-FLT_MAX</td>
<td id="_00af6969-a47a-9845-1e86-9fa315d401e6" valign="top" align="left">-FLT_MAX</td>
<td id="_1e703a31-960c-548a-d06a-67f6f3d0e926" valign="top" align="left">-FLT_MAX</td>
</tr><tr id="_56200229-bb61-feb5-0514-cca98da7d5dd"><td id="_bec2b5fc-c876-fb13-c243-d66ed592870a" valign="top" align="left">else</td>
<td id="_af8673a0-2d43-27df-693a-9d4d753303c3" valign="top" align="left">RNE</td>
<td id="_ac37d491-3ad0-efca-75b3-854e6926a7fb" valign="top" align="left">RNE</td>
<td id="_4e86045c-bc63-8ff4-0cdc-6dc69025bd81" valign="top" align="left">RNE</td>
<td id="_257ea90c-0d21-b6f7-c9a2-f00fb1a7c940" valign="top" align="left">RNE</td>
</tr></tbody>
</table>

<p id="_c92192ab-118d-674a-cb7a-f33e12918ce0">The behavior changes if the parameter ‘saturate’ is set to False. The rules then become:</p>

<table id="_d4a20e1a-4078-ac86-7fdf-640493fb24c8">
<name id="_29dc4b65-1078-8925-0994-36f8022ad297">Table from the upstream description of <tt>Cast</tt></name>
<thead><tr id="_30c63845-f5a4-1dc0-d70b-c468ab971ec8"><th id="_5a01eaa3-9ba0-f57a-d212-67f0caf0bd52" valign="top" align="left">x</th>
<th id="_04d671ff-94b1-bb98-a6c6-dc93e3cff911" valign="top" align="left">E4M3FN</th>
<th id="_02ac6389-3fea-0cb0-bbe2-f503219b8945" valign="top" align="left">E4M3FNUZ</th>
<th id="_e7de1265-4409-4cc5-f086-9c198cba70ae" valign="top" align="left">E5M2</th>
<th id="_66841fbb-5bb1-1c1a-6d04-426cc7a346e6" valign="top" align="left">E5M2FNUZ</th>
</tr></thead>
<tbody><tr id="_3c0b42e6-d0fb-4a0a-e0f6-c92b92b90eb6"><td id="_f8f2716e-a74c-c63d-4d9b-2cdb6e3709b1" valign="top" align="left">0</td>
<td id="_17c791cc-46a2-2e84-e2cf-b21041201a19" valign="top" align="left">0</td>
<td id="_ad08690b-d82b-9e8f-da83-2bcead9f3813" valign="top" align="left">0</td>
<td id="_31bd4ff7-f6cd-75ee-27ce-6314e5a11ca1" valign="top" align="left">0</td>
<td id="_ba31939a-cafe-6753-2f60-77a8f5e38370" valign="top" align="left">0</td>
</tr><tr id="_eab275f7-4c74-f10a-ddf5-4d1f08f240d6"><td id="_b1265d11-5ddb-26c0-7a33-7ddd974b4140" valign="top" align="left">-0</td>
<td id="_dee13b5a-c55c-d2bc-43e3-531eeed50ff7" valign="top" align="left">-0</td>
<td id="_7f6265bd-1ff3-0dc2-1b77-a96e07631c1d" valign="top" align="left">0</td>
<td id="_353c54ed-3259-8f5b-75ea-7592276faff7" valign="top" align="left">-0</td>
<td id="_3d97730c-dc2e-8f69-3a6a-6740e065bb8b" valign="top" align="left">0</td>
</tr><tr id="_f936f818-28f1-cb9d-a45a-3e1ed3d50fa6"><td id="_828dd400-c54b-61db-cf2c-50b5e4a9097a" valign="top" align="left">NaN</td>
<td id="_a0e09707-f7a2-9674-265d-b55437b5f45c" valign="top" align="left">NaN</td>
<td id="_da286841-bb15-9e3d-1ac9-a887b9b7df7f" valign="top" align="left">NaN</td>
<td id="_71caabd1-fa99-50fd-bac6-5527bcb17bbb" valign="top" align="left">NaN</td>
<td id="_ae219cc8-b7d2-e99b-0ca0-c3ca1dab4847" valign="top" align="left">NaN</td>
</tr><tr id="_6dec62d8-17d6-3412-2ca2-7501ac53455c"><td id="_0c44c885-b0e6-292a-5c7a-2156842f88c0" valign="top" align="left">-NaN</td>
<td id="_a8b53b0e-a9a6-eb36-397f-378a4d15ad77" valign="top" align="left">-NaN</td>
<td id="_97f8ac05-1588-3102-5a08-5c0a74cd70fc" valign="top" align="left">NaN</td>
<td id="_9b73873f-d327-13e4-cac4-3e52897ce28e" valign="top" align="left">-NaN</td>
<td id="_6cbfaa57-6a20-73ca-5037-14341330282e" valign="top" align="left">NaN</td>
</tr><tr id="_eeddd671-312e-ef9b-6a85-0e1fe1879f43"><td id="_ac99acc1-a30e-4b2a-0ff0-b83869c05f9a" valign="top" align="left">Inf</td>
<td id="_5ec8f0f8-33e4-944b-691b-b8916509151c" valign="top" align="left">NaN</td>
<td id="_ab74554f-e772-a812-ff90-3b7176a28e73" valign="top" align="left">NaN</td>
<td id="_bcdfdf58-6230-1662-1b44-086726e5799f" valign="top" align="left">Inf</td>
<td id="_86b4f211-fe89-2a6b-af8d-fa3706196151" valign="top" align="left">NaN</td>
</tr><tr id="_371fa2b1-7f1e-ae9d-270f-4ce2ade5104a"><td id="_3fa33f28-b625-9531-4c7d-96672c09a8ea" valign="top" align="left">-Inf</td>
<td id="_7680de5b-8a00-7e27-629e-f7aca328256b" valign="top" align="left">-NaN</td>
<td id="_1b1588a3-b70d-4e9f-63bd-747c436654b4" valign="top" align="left">NaN</td>
<td id="_b2cc2421-1455-6d86-5dac-e805016d8ea3" valign="top" align="left">-Inf</td>
<td id="_f370c24c-546c-c164-3778-8da4cfc16627" valign="top" align="left">NaN</td>
</tr><tr id="_249a4424-f330-ae15-6a50-83c9f2835880"><td id="_7c1eaa01-f813-11f8-4577-ce20915f5f2f" valign="top" align="left">[x] &gt; FLT_MAX</td>
<td id="_17f5818e-a29f-cb4a-e48e-aa5d33975a6e" valign="top" align="left">NaN</td>
<td id="_fae19e1c-06b6-083f-a7f2-04a82cd3777e" valign="top" align="left">NaN</td>
<td id="_204feeaf-2c0a-8eaa-4b32-a0d7ba981ba6" valign="top" align="left">Inf</td>
<td id="_ea14d568-6f6f-4642-4bbe-a61495f1495d" valign="top" align="left">NaN</td>
</tr><tr id="_d847320a-4478-e4ac-929f-962be4f32101"><td id="_9b488735-9f7e-489b-e8b5-a299640e6fae" valign="top" align="left">[x] &lt; -FLT_MAX</td>
<td id="_455d893c-5216-5198-75aa-ce3412cbb4ca" valign="top" align="left">NaN</td>
<td id="_2de2ebc2-6739-812e-ad91-21697ce2b8eb" valign="top" align="left">NaN</td>
<td id="_50b99151-759c-952e-ab39-100aac2ffdac" valign="top" align="left">-Inf</td>
<td id="_1be2141d-6ab0-5db6-0a1b-f42796d63349" valign="top" align="left">NaN</td>
</tr><tr id="_07da6d25-29e8-4388-af95-8c80dacb568b"><td id="_ffa14d4d-2d1b-79f7-c822-64763b5a21fa" valign="top" align="left">else</td>
<td id="_af84c9da-c96c-caf6-71b5-26609c791802" valign="top" align="left">RNE</td>
<td id="_29a8c838-5055-c578-51ad-f6821cc45faf" valign="top" align="left">RNE</td>
<td id="_fc91d409-f199-7489-483c-6d02424021e1" valign="top" align="left">RNE</td>
<td id="_3936d7c3-35b6-5fad-a637-473470962261" valign="top" align="left">RNE</td>
</tr></tbody>
</table>

<p id="_f32c0e24-cc62-5e6b-1dee-7b86d77bfcd0">FLOAT8E8M0 type was introduced to enable <link target="https://www.opencompute.org/documents/ocp-microscaling-formats-mx-v1-0-spec-final-pdf">Microscaling (MX) formats</link>. When casting to FLOAT8E8M0, the rounding behavior can be specified using the  <tt>round_mode</tt> and <tt>saturate</tt> attributes. The current CUDA behavior is to round up and saturate. Casting negative values to FLOAT8E8M0 gives undefined behavior. The following table describes the casting behavior of special values to FLOAT8E8M0 in the two most common cases.</p>

<table id="_a29869c8-7a54-9287-b572-23173b848bff">
<name id="_91521825-33c2-5f1e-3f01-eb4688eadd7e">Table from the upstream description of <tt>Cast</tt></name>
<thead><tr id="_ac86b786-6b38-feb7-bb61-880296c827a9"><th id="_92e8e186-0ba6-c6ba-d4fe-01e54ac1edcd" valign="top" align="left">x</th>
<th id="_ed18c142-759d-2058-81f9-7321aaa314d4" valign="top" align="left">saturate + up</th>
<th id="_3ddc31d5-e62b-12da-c4cd-a31a59aaca55" valign="top" align="left">non-saturate + nearest</th>
</tr></thead>
<tbody><tr id="_de1e8cd1-5add-e175-36ba-11cb42e40ce9"><td id="_8e2357e9-8a8e-4093-0c31-d94dd3157bc7" valign="top" align="left">0</td>
<td id="_734e46e9-20a7-2e7e-af47-e8183bbb145b" valign="top" align="left">0</td>
<td id="_f1658efd-2e1d-07c1-47a4-774dee0c3737" valign="top" align="left">NaN</td>
</tr><tr id="_61c65997-4ca3-65c5-2faa-bc774f791d3d"><td id="_1da4d656-e50a-d38f-bbfe-a1711c1c7e7c" valign="top" align="left">-0</td>
<td id="_0cb95156-475a-6ff8-2710-54a7826da9cb" valign="top" align="left">Unspecified</td>
<td id="_5215de0e-328a-1b1a-b3ba-bbfc5e167181" valign="top" align="left">Unspecified</td>
</tr><tr id="_99d8d00c-c04a-f31e-a9fb-89519f9b2670"><td id="_8f33ab93-f535-b2e8-5967-2d65fe1b7042" valign="top" align="left">NaN</td>
<td id="_d5a9e296-35fa-ab45-8f47-00c9c28c8666" valign="top" align="left">NaN</td>
<td id="_6e29cc0e-a754-d399-6198-44c48940a8e3" valign="top" align="left">NaN</td>
</tr><tr id="_471244ea-2627-a9b3-3592-3b958c5657ca"><td id="_a4e4520f-4168-da86-2a78-8618f393562b" valign="top" align="left">Inf</td>
<td id="_2ebe8c58-4de8-c0a6-7218-9fec32a2551f" valign="top" align="left">E8M0_MAX</td>
<td id="_aef6761c-5a5e-52e5-76fe-2f93064d967d" valign="top" align="left">NaN</td>
</tr><tr id="_c624a0c1-5dea-6713-aee2-10337a319b0c"><td id="_5d689b79-af50-96b3-0ba1-c534eca1937b" valign="top" align="left">x &gt; E8M0_MAX</td>
<td id="_c1a62be2-3fde-ecc0-a07d-6dbf436750d7" valign="top" align="left">E8M0_MAX</td>
<td id="_5d2176fc-8d92-bf77-3d87-5a7fadd5729a" valign="top" align="left">NaN</td>
</tr><tr id="_a15af3b0-722e-3cf1-35bd-dad983f6343c"><td id="_23c3cb42-f013-043a-dc42-35a41f5e260a" valign="top" align="left">x &lt; E8M0_MIN</td>
<td id="_d00fda3b-8860-cf0a-b6cd-d14d1b0dc38f" valign="top" align="left">E8M0_MIN</td>
<td id="_883c7a6d-6c83-daf6-1986-f4627c4482b8" valign="top" align="left">NaN</td>
</tr><tr id="_ec5103a0-a8fc-4923-c372-b3381997ccd8"><td id="_ab0ae59e-d61d-b780-8e4e-9c942cbc39fc" valign="top" align="left">x &lt; 0</td>
<td id="_e242a89d-5eaa-3213-7da2-3de71f319923" valign="top" align="left">Unspecified</td>
<td id="_b778f07c-2ee4-33f1-1569-47dc4a0ff9af" valign="top" align="left">Unspecified</td>
</tr></tbody>
</table>

<dl id="_c849fd9c-beb7-3d49-9ad3-74ce141a6c93"><dt>Domain</dt>
<dd id="_c012a79f-e217-f8b6-800e-74e4a21a7a88"><p id="_95c4798b-9bbf-6576-4ee5-24a9f6e48917"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_5dfd972b-c0c7-38f5-9e37-888fd7113fbe"><p id="_77ab76cd-1094-fa86-63c1-1041f16a1df6">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_47372a88-2b17-c5f9-7920-e9baa63a0247"><p id="_a0641713-e15b-ec13-50bb-ce17b29f937f">1, 6, 9, 13, 19, 21, 23, 24, 25</p>
</dd>
<dt>Inputs</dt>
<dd id="_f46fdc21-6503-3ad3-9ae7-997c6878d1b9"><p id="_5f04f850-9bf0-eb77-da13-a1c1dba987a5"><tt>input (differentiable) : T1</tt> — Input tensor to be cast.</p>
</dd>
<dt>Outputs</dt>
<dd id="_9f7c5cc6-db94-c73d-4bf5-4c653dbbd01b"><p id="_cadf2530-592e-38ea-0f5d-d8f6e034ec57"><tt>output (differentiable) : T2</tt> — Output tensor with the same shape as input with type specified by the ‘to’ argument</p>
</dd>
<dt>Attributes</dt>
<dd id="_cbd2b754-5aae-eca3-a49c-6b22030dc828"><p id="_0c3bde6b-1eca-0b02-4dc2-ae9a8e8aab01"><tt>round_mode : string (default is up)</tt> — Rounding mode for conversion to float8e8m0. It only applies to casting to float8e8m0 and is <tt>up</tt> by default. <tt>up</tt>: round to nearest value away from zero, <tt>down</tt>: round to nearest value towards zero, <tt>nearest</tt>: round to nearest value and ties round up.<br/> <tt>saturate : int (default is 1)</tt> — The parameter defines how the conversion behaves if an input value is out of range of the destination type. It only applies for float 8 conversion (float8e4m3fn, float8e4m3fnuz, float8e5m2, float8e5m2fnuz, float8e8m0). It is true by default. All cases are fully described in the tables inserted in the operator description.<br/> <tt>to : int (required)</tt> — The data type to which the elements of the input tensor are cast. Strictly must be one of the types from DataType enum in TensorProto</p>
</dd>
<dt>Type constraints</dt>
<dd id="_f798cc30-037d-0615-a387-e3780771d712"><p id="_83db8b7f-bc7f-f16f-1a42-12706054477e"><tt>T1 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2), tensor(float6e2m3), tensor(float6e3m2)</tt> — Constrain input types. Casting from complex is not supported.<br/> <tt>T2 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2), tensor(float6e2m3), tensor(float6e3m2)</tt> — Constrain output types. Casting to complex is not supported.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_30ee1801-db09-10b3-1ceb-46dfac9011fe"><p id="_ac4ba3e2-7dee-0105-21a4-7665dbd5732d"><tt>test_cast_</tt>, <tt>test_cast_e8m0_</tt>, <tt>test_cast_no_saturate_</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_69b4de7e-6b0b-d901-5a61-d0a942234d76"><p id="_dc0dc386-8dc9-25f4-f7e2-c656d0b7ed8b">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_779eb1f1-af6b-e033-45d5-29fd167fef91" anchor="op-ai-onnx-default-castlike" obligation="normative">
<title id="_bac35645-bae3-947d-41e4-c34214db47a9">CastLike</title>
<p id="_e82ed1f4-21fe-ea88-0663-efb6e4b2b744">The operator casts the elements of a given input tensor (the first input) to the same data type as the elements of the second input tensor. See documentation of the Cast operator for further details.</p>

<dl id="_e67d41ec-59c2-61e2-6b58-a484688697ec"><dt>Domain</dt>
<dd id="_30653728-3c0f-56f0-2f4b-d16dc9b2bf9e"><p id="_33f3a07a-f70e-ec5d-42e6-84a78c2eb9a4"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_f5bea853-7f34-3f6d-131d-f13277d52869"><p id="_fad1e466-6120-516d-dff7-0b5eea8c5468">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_e1ac7e14-9423-d13d-f0cd-ad76ac76d1bf"><p id="_ffe67d07-d8bf-d326-2857-8eb0a60fa06d">15, 19, 21, 23, 24</p>
</dd>
<dt>Inputs</dt>
<dd id="_60f26d20-9173-f75f-404f-3d62c1c94d16"><p id="_74292244-80cd-1ea1-7784-7b00f64efd94"><tt>input (differentiable) : T1</tt> — Input tensor to be cast.<br/> <tt>target_type (non-differentiable) : T2</tt> — The (first) input tensor will be cast to produce a tensor of the same type as this (second input) tensor.</p>
</dd>
<dt>Outputs</dt>
<dd id="_61e48fd7-187a-20c1-2701-d8439963bb64"><p id="_dd991c53-0f8b-8a28-7462-279c07d59af7"><tt>output (differentiable) : T2</tt> — Output tensor produced by casting the first input tensor to have the same type as the second input tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_455d4246-1567-b263-aacb-5b590c9e57cb"><p id="_fee24c3c-ec8a-d834-931a-7cd7491dcd32"><tt>round_mode : string (default is up)</tt> — Rounding mode for conversion to float8e8m0. It only applies to casting to float8e8m0 and is <tt>up</tt> by default. <tt>up</tt>: round to nearest value away from zero, <tt>down</tt>: round to nearest value towards zero, <tt>nearest</tt>: round to nearest value and ties round up. Please refer to operator Cast description for further details.<br/> <tt>saturate : int (default is 1)</tt> — The parameter defines how the conversion behaves if an input value is out of range of the destination type. It only applies for float 8 conversion (float8e4m3fn, float8e4m3fnuz, float8e5m2, float8e5m2fnuz, float8e8m0). It is true by default. Please refer to operator Cast description for further details.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_22b7027b-3de3-a3e2-e6a6-9fe2f3791f5a"><p id="_e0326101-b42f-b767-7185-5bcfcca0ee57"><tt>T1 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2)</tt> — Constrain input types. Casting from complex is not supported.<br/> <tt>T2 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2)</tt> — Constrain output types. Casting to complex is not supported.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_29deb4a8-41ef-a134-6134-25ea0f7e4512"><p id="_73b28771-ed8a-dd17-388c-9e22888e3d36"><tt>test_castlike_</tt>, <tt>test_castlike_no_saturate_</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_60363732-92f6-8d08-609f-5d337775c209"><p id="_e40b3f7b-3522-ad08-4e96-a1d2260817c9">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_88854de6-ad30-76a3-c223-29b9bd956682" anchor="op-ai-onnx-default-causalconvwithstate" obligation="normative">
<title id="_dd3eb35e-df84-a8ad-a338-2ec12b2d656d">CausalConvWithState</title>
<p id="_62b437d7-d20d-e414-56f0-19f217f117e5">Stateful causal 1D depthwise convolution.</p>

<p id="_dd598a63-de1d-bbe7-650e-2a3293045ca6">Used by Gated DeltaNet (Qwen3.5) and Mamba (Jamba, FalconMamba) as a preprocessing step. Replaces the 3-op pattern (Concat + Conv + Slice) with a single fused operation.</p>

<p id="_e393b3dc-969e-f79b-5fc5-aefe747fdcd2">The convolution is causal (looks only at current and past positions) and depthwise (each channel is convolved independently with its own kernel).</p>

<p id="_7edf0ab2-fb2b-ebf5-7022-a6907762d931">The input, weight, past_state, output, and present_state tensors are rank-3 with shape (batch_size, channels, length). The optional bias input is rank-1 with shape (channels). For higher-dimensional data, use Reshape nodes before and after this operator to pack extra dimensions into the batch or channel axis.</p>

<p id="_1a368564-32a6-7965-5f6f-a615aedece20">Weight layout: (channels, 1, k) for depthwise convolution. The carry state stores the last (k-1) positions for incremental decode.</p>

<p id="_f2bc23c0-70ce-2a06-80d6-671fb3814f08">The optional activation attribute supports fused SiLU/Swish activation.</p>

<dl id="_2703ef5a-6901-86ec-0b9b-f7d97bed8ab9"><dt>Domain</dt>
<dd id="_0140dd6c-60e7-83ea-6310-51aa68103afb"><p id="_c5a623a7-b730-3737-ff6c-c7d46cfb489f"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_8c7b88d2-9bbf-a628-ab78-1aee7eeedf7b"><p id="_85c03d3b-b1a7-1e36-13c2-5482798deea3">27</p>
</dd>
<dt>Inputs (2 — 4)</dt>
<dd id="_e8201402-a0ab-a457-2ce0-e434536c655a"><p id="_8ecd2373-7baa-7d29-c731-f99f4c45f599"><tt>input (differentiable) : T</tt> — Input tensor with shape (batch_size, channels, length). Channels-first layout.<br/> <tt>weight (differentiable) : T</tt> — Depthwise convolution kernel with shape (channels, 1, k) where k is the kernel size. The middle dim of size 1 follows the ONNX <tt>Conv</tt> weight layout <tt>(M, C/group, k1, ..., kn)</tt>: since this op is always depthwise, <tt>group = channels</tt>, so <tt>C/group = 1</tt>. Keeping this layout makes the weight tensor a drop-in for a depthwise <tt>Conv(group=channels)</tt> weight, so <tt>Conv</tt> <tt>CausalConvWithState</tt> rewrites require no reshape.<br/> <tt>bias (optional, differentiable) : T</tt> — Optional per-channel bias with shape (channels).<br/> <tt>past_state (optional, non-differentiable) : T</tt> — Carry state from previous step with shape (batch_size, channels, k — 1). If not provided, padding is zero.</p>
</dd>
<dt>Outputs</dt>
<dd id="_17817ea7-feeb-4b28-f081-faa9e86a673c"><p id="_4914253d-2e2a-cbca-72b5-e3f2cc980ad5"><tt>output (differentiable) : T</tt> — Convolution output with same shape as input.<br/> <tt>present_state (non-differentiable) : T</tt> — Updated carry state with shape (batch_size, channels, k — 1). Contains the last (k — 1) values of the effective padded/concatenated sequence along the causal axis, including any values from past_state or zero-padding when the current input is shorter than k — 1.</p>
</dd>
<dt>Attributes</dt>
<dd id="_8f033e46-b1d7-f0ea-1d9d-c188cb5ae70a"><p id="_e7a48f7c-2c9d-21b1-be2a-6b3f05547d9a"><tt>activation : string (default is none)</tt> — Fused activation function. One of: ‘silu’, ‘swish’, ‘none’. Default is ‘none’.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_9ca1bd75-ca9f-0b41-6821-43b60779af13"><p id="_dae4a531-cbb0-96f8-1407-66def9327f09"><tt>T : tensor(float), tensor(float16), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_9dadb735-4816-e2a8-765e-1d3a6b2fe331"><p id="_57a00a02-9af6-93a9-78ba-6528b515a1e8"><tt>test_causal_conv_with_state_b1_c1_degenerate</tt>, <tt>test_causal_conv_with_state_basic</tt>, <tt>test_causal_conv_with_state_decode_step</tt>, <tt>test_causal_conv_with_state_fp16</tt>, <tt>test_causal_conv_with_state_kernel_size_one</tt>, <tt>test_causal_conv_with_state_short_input_no_past_state</tt>, <tt>test_causal_conv_with_state_silu</tt>, <tt>test_causal_conv_with_state_silu_fp16</tt>, <tt>test_causal_conv_with_state_silu_with_past_state</tt>, <tt>test_causal_conv_with_state_swish_alias</tt>, <tt>test_causal_conv_with_state_with_bias</tt>, <tt>test_causal_conv_with_state_with_bias_and_past_state</tt>, <tt>test_causal_conv_with_state_with_past_state</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_530d9d31-a583-cd1f-52e3-9bfeadf187b7"><p id="_36d0ff2f-9243-2c43-4b49-871e30bebf49">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_4a5fdc29-7a14-28d3-22cb-544299cc3f5b" anchor="op-ai-onnx-default-ceil" obligation="normative">
<title id="_d09b6cc5-ec60-d0ee-abcf-617c7154f6de">Ceil</title>
<p id="_f7d4f67d-71b9-f8e9-b904-3238f12ff371">Ceil takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the ceil is, y = ceil(x), is applied to the tensor elementwise. If x is integral, +0, -0, NaN,  or infinite, x itself is returned.</p>

<dl id="_1e5023ab-bdb3-6e76-c204-3d800a189f89"><dt>Domain</dt>
<dd id="_791c02bb-a16f-246c-ad7e-349978672770"><p id="_7d6f1612-5a42-9c02-ba0f-7dcb9fdf07cf"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_5ab41bf6-4eab-b14e-4fd9-f54f1c35f931"><p id="_66dc87f7-5ba0-1f2e-23bb-59cddfa5900e">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_1486e3d1-fee2-e2f7-8778-46ffe268e463"><p id="_7e2e376b-45b0-0b17-6cdf-fc22d2b0544a">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_87ffc0f3-54b0-c3cf-226a-7d1c497d5ce0"><p id="_57320f8a-4395-f655-bf3b-37aafc718a2d"><tt>X (non-differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_c4334281-4ba6-8d7d-b1af-685c4c9eb2b1"><p id="_378ca961-9c28-69e5-9c10-4a9efe39d65f"><tt>Y (non-differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_100368e7-d147-a4d7-1deb-73168c0df2d2"><p id="_163ad7f4-d141-09c4-6fc1-e5ce4d46550d">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_b23cac09-a32f-7ffc-0e5a-942e322e6f2a"><p id="_eb344721-8def-5feb-60b3-1e3f6faf21dc"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_d951d04d-b779-637c-2da9-3baeae83bd16"><p id="_3a16273b-908c-1074-6bf7-63ada770008a"><tt>test_ceil_example</tt>, <tt>test_ceil</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_a767cbbc-ab65-958c-315c-706715c3e8a2"><p id="_72519194-aae0-d47f-51b1-75a44ea7765d">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_d8e2cb9c-52b0-876d-1597-bd252de75bda" anchor="op-ai-onnx-default-celu" obligation="normative">
<title id="_18df361e-deb3-12e3-cfd9-1ce6dd3ddb3e">Celu</title>
<p id="_4898ecaa-9f71-e61c-e08e-c0641f9dc654">Continuously Differentiable Exponential Linear Units: Perform the linear unit element-wise on the input tensor X using formula:</p>

<sourcecode id="_d2412835-2306-cb2b-8fb7-619c31044dad" unnumbered="true"><body>max(0,x) + min(0,alpha*(exp(x/alpha)-1))</body></sourcecode>


<dl id="_afbf7201-d45c-f02b-71da-ea2f21cdb9e8"><dt>Domain</dt>
<dd id="_51a50a88-0fae-4c04-88fb-3103d323102a"><p id="_9976e512-0505-b282-6790-19c88690c018"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_07672ba7-93cf-3a43-07ea-0b0d32e49bf6"><p id="_ecc9bd73-4e82-6c7a-c512-584d05d43abf">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_e3da9691-8dd7-9838-625b-40a08a89ca84"><p id="_2407c3dc-74bd-4bfc-58d1-9b38d5577ce9">12</p>
</dd>
<dt>Inputs</dt>
<dd id="_623dd032-6666-2756-fd83-91bb89953ee3"><p id="_d5801843-8415-680d-4b39-99870cafce3d"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_0399ae28-3fba-2619-ad2a-d3b8ef0b86a5"><p id="_a213b3dc-a124-2169-819d-859eeadda8c2"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_2dc75071-b5eb-ba93-4b32-6ccd60d7d6c0"><p id="_3e481358-a8e0-33dd-b4e1-c661c2dc7ced"><tt>alpha : float (default is 1.0)</tt> — The Alpha value in Celu formula which control the shape of the unit. The default value is 1.0.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_e6d5e1bd-df66-609f-35fe-7a35723721f8"><p id="_fd09ea72-2e04-64e1-ebef-d6a60a74aa85"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_7c7dad6f-0497-ba32-4928-ad33076c6e60"><p id="_ec42fb79-1f00-519e-89b3-f00493bf9b9a"><tt>test_celu</tt>, <tt>test_celu_bfloat16</tt>, <tt>test_celu_float16</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_9e847041-df03-c2ad-e33f-a01625492e02"><p id="_806a60b6-8937-6719-b515-273b62e9395b">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_1efcd53c-1d00-987c-0fa0-8f9e5e7dc2e2" anchor="op-ai-onnx-default-centercroppad" obligation="normative">
<title id="_f84fe82f-7748-6a00-053a-9a37501f074c">CenterCropPad</title>
<p id="_954cad72-6890-e520-b635-d42981246e81">Center crop or pad an input to given dimensions.</p>

<p id="_62136aa6-222b-1291-6c0b-47b8364664a4">The crop/pad dimensions can be specified for a subset of the <tt>axes</tt>; unspecified dimensions will remain unchanged.</p>

<p id="_9129926b-f297-bca6-1e95-678541345922">If the input dimensions are larger than the target crop dimensions, a centered cropping window will be extracted from the input. The starting value for the cropping window is rounded down, which means that if the difference between the input shape and the crop shape is odd, the cropping window will be shifted half a pixel to the left of the input center.</p>

<p id="_0b154139-25aa-05a2-0a80-893d66913aca">If the input dimensions are smaller than the target crop dimensions, the input will be padded equally on both sides to center it in the output. In cases where the total number of padding pixels is odd, an additional pixel will be added to the right side.</p>

<p id="_596a4e7f-02bc-6149-cba0-725981f3540c">The padding value used is zero.</p>

<dl id="_cf45f73d-dc64-46c9-eb82-9f31bf5494c3"><dt>Domain</dt>
<dd id="_d7f53d54-4be1-9c7e-8a2f-1b19e217b2a0"><p id="_a1fed3ab-e6a6-e5ea-ca23-22af184e3dcb"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_29d51fa9-c579-6f39-4599-c526b6fbeb68"><p id="_3cc3285c-94d1-574f-5250-5c433622f128">18</p>
</dd>
<dt>Inputs</dt>
<dd id="_da53b028-2609-0028-34cd-2a9ae9567775"><p id="_ca831042-a4ba-0c89-f65f-65bdfd060987"><tt>input_data (differentiable) : T</tt> — Input to extract the centered crop from.<br/> <tt>shape (non-differentiable) : Tind</tt> — 1-D tensor representing the cropping window dimensions.</p>
</dd>
<dt>Outputs</dt>
<dd id="_78fb75d0-f59d-ddb9-3818-e6cd27d8dc29"><p id="_2a8f9007-858a-7bbb-8232-9f26cf201455"><tt>output_data (differentiable) : T</tt> — Output data.</p>
</dd>
<dt>Attributes</dt>
<dd id="_7e21d899-2439-2696-a46c-547fbc9195a9"><p id="_9a294b15-ce69-03ae-f326-ac3c19493cdc"><tt>axes : list of ints</tt> — If provided, it specifies a subset of axes that ‘shape’ refer to. If not provided, all axes are assumed [0, 1, …​, r-1], where r = rank(data). Negative value means counting dimensions from the back. Accepted range is [-r, r-1], where r = rank(data). Behavior is undefined if an axis is repeated.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_4c611cc2-37dd-20ea-ade3-221a18e1c8b3"><p id="_99c9c481-1e45-1322-72fd-74cb4d6ec45b"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input and output types to all tensor types.<br/> <tt>Tind : tensor(int32), tensor(int64)</tt> — Constrain indices to integer types</p>
</dd>
<dt>Test vectors</dt>
<dd id="_66800d37-bbf3-aed7-ee23-9250e503b650"><p id="_2fe35d9d-e48d-b3c6-de4c-16fac194e284"><tt>test_center_crop_pad_crop</tt>, <tt>test_center_crop_pad_crop_and_pad</tt>, <tt>test_center_crop_pad_crop_axes_chw</tt>, <tt>test_center_crop_pad_crop_axes_hwc</tt>, <tt>test_center_crop_pad_crop_negative_axes_hwc</tt>, <tt>test_center_crop_pad_pad</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_24aeae00-86ff-0acd-b8f5-522604b6a70d"><p id="_8bdda95d-9dd7-2f06-0f6a-ec32eb73ee83">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_a2e2cb1c-8727-0560-cfb9-d5e03b3d6af2" anchor="op-ai-onnx-default-clip" obligation="normative">
<title id="_886112a8-6658-5de4-9305-b977d1a71b95">Clip</title>
<p id="_3fed8cfb-1f72-2b31-d8f4-77bcd06431cd">Clip operator limits the given input within an interval. The interval is specified by the inputs ‘min’ and ‘max’. They default to numeric_limits::lowest() and numeric_limits::max(), respectively. When ‘min’ is greater than ‘max’, the clip operator sets all the ‘input’ values to the value of ‘max’. Thus, this is equivalent to ‘Min(max, Max(input, min))’.</p>

<dl id="_244e5afa-448e-dbea-697f-4afbd351c198"><dt>Domain</dt>
<dd id="_c49322e0-c1e3-f6c8-fbca-18e5fd4e1780"><p id="_d63ceea0-2421-5b72-4f8a-f98f86cb603a"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_4afbdfec-8da9-a3e7-5d12-b2df3a620650"><p id="_4b815d5a-1df2-7647-b8a5-f3050458960c">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_9e559673-b9ba-4617-c94e-d02b50aae704"><p id="_441b41da-9a27-b1fd-07a1-88f720ddaa49">1, 6, 11, 12</p>
</dd>
<dt>Inputs (1 — 3)</dt>
<dd id="_d738df03-9bd9-029f-b321-8f1c0fc1fe06"><p id="_8302b33e-c828-6e3f-ed21-d96186d9804f"><tt>input (differentiable) : T</tt> — Input tensor whose elements to be clipped<br/> <tt>min (optional, non-differentiable) : T</tt> — Minimum value, under which element is replaced by min. It must be a scalar(tensor of empty shape).<br/> <tt>max (optional, non-differentiable) : T</tt> — Maximum value, above which element is replaced by max. It must be a scalar(tensor of empty shape).</p>
</dd>
<dt>Outputs</dt>
<dd id="_f18b7e3b-10f5-f141-a440-bba0467923d1"><p id="_bc1d1348-5cc4-319a-ea31-fd49fb345e94"><tt>output (differentiable) : T</tt> — Output tensor with clipped input elements</p>
</dd>
<dt>Attributes</dt>
<dd id="_dd5463ba-3f13-a2a7-394e-49d533302142"><p id="_a20c6164-3eb3-cc08-cea0-c80539141d92">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_27a8c301-ad17-d25b-1175-fbfc603b6287"><p id="_72519bf6-70a4-494a-2993-cfcc1b59cead"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to all numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_4e48ad79-b323-d038-ebd1-230fbdb2c8ad"><p id="_640702f7-8ed3-9455-23b7-e439d71d1189"><tt>test_clip_example</tt>, <tt>test_clip</tt>, <tt>test_clip_inbounds</tt>, <tt>test_clip_outbounds</tt>, <tt>test_clip_splitbounds</tt>, <tt>test_clip_min_greater_than_max</tt>, <tt>test_clip_default_min</tt>, <tt>test_clip_default_max</tt>, <tt>test_clip_default_inbounds</tt>, <tt>test_clip_default_int8_min</tt>, <tt>test_clip_default_int8_max</tt>, <tt>test_clip_default_int8_inbounds</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_c675f833-0e71-4d99-d29a-91f3153cc4d8"><p id="_6b6f1c7b-dfd0-e387-cf2b-08eaf746ae11">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_aa2ded27-b907-0583-75a4-86ad529083ff" anchor="op-ai-onnx-default-col2im" obligation="normative">
<title id="_386c60dc-a7b8-0640-05ef-86b456d87d86">Col2Im</title>
<p id="_e55e5f61-ef90-5234-fece-6fd253bf954c">The operator rearranges column blocks back into a multidimensional image</p>

<p id="_d30dabaf-db6c-ea40-c9f5-c44214efbfa0">Col2Im behaves similarly to PyTorch’s fold <link target="https://pytorch.org/docs/stable/generated/torch.nn.Fold.html"/>, but it only supports  <em>batched</em> multi-dimensional image tensors. Another implementation in Python with N-dimension support can be found at  <link target="https://github.com/f-dangel/unfoldNd/"/>.</p>

<p id="_17272922-51ab-7229-fd42-dd7ba5e67cd0">NOTE:   Although specifying image_shape looks redundant because it could be calculated from   convolution formulas, it is required as input for more advanced scenarios as explained   at PyTorch’s implementation (<link target="https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/Col2Im.cpp#L10"/>)</p>

<dl id="_a809af93-d710-a8de-ed81-a1acc03812fd"><dt>Domain</dt>
<dd id="_d4536151-3f36-0515-0160-09ada3689b63"><p id="_7238ede4-d502-979c-f4c9-e10e5ce94de7"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_fa0545c9-04f8-f603-1386-f09838bbb312"><p id="_554f48dc-248e-6f8a-4597-ed750726de51">18</p>
</dd>
<dt>Inputs</dt>
<dd id="_a9d96aea-1d81-9226-23cc-95020de91d07"><p id="_2cea4c29-3909-aed3-fce3-12fff416a4e0"><tt>input (differentiable) : T</tt> — Input data tensor to be rearranged from column blocks back into an image. This is a 3-dimensional tensor containing [N, C * n-ary-product(block_shape), L], where N is batch dimension, C is image channel dimension and L is number of blocks.The blocks are enumerated in increasing lexicographic-order of their indices.For example, with an image-size 10<em>20 and block-size 9</em>18, there would be 2*3 blocks, enumerated in the order block(0, 0), block(0, 1), block(0, 2), block(1, 0), block(1, 1), block(1, 2).<br/> <tt>image_shape (non-differentiable) : tensor(int64)</tt> — The shape of the spatial dimensions of the image after rearranging the column blocks.This is a 1-dimensional tensor with size of at least 2, containing the value [H_img, W_img] for a 2-D image or [dim_i1, dim_i2, …​, dim_iN] for a N-D image.<br/> <tt>block_shape (non-differentiable) : tensor(int64)</tt> — The shape of the block to apply on the input.This is a 1-dimensional tensor of size of at least 2, containing the value [H_block, W_block] for a 2-D image or [dim_b1, dim_b2, …​, dim_bN] for a N-D block.This is the block-shape before dilation is applied to it.</p>
</dd>
<dt>Outputs</dt>
<dd id="_c4f7dcbe-5f96-c8b6-528e-a4bfc512dcff"><p id="_8fed41cb-043a-64b1-e63a-cb7e3935fd8c"><tt>output (differentiable) : T</tt> — Output tensor produced by rearranging blocks into an image.</p>
</dd>
<dt>Attributes</dt>
<dd id="_a7ae4a2c-11af-84fb-df16-2197e92d4525"><p id="_d2fd2621-87c5-72dc-adf5-3b58aa96fc77"><tt>dilations : list of ints</tt> — 1-dimensional tensor with dilation value along each spatial axis of the image. If not present, the dilation defaults to 1 along each spatial axis of the image.<br/> <tt>pads : list of ints</tt> — 1-dimensional tensor with padding value for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis. <tt>pads</tt> format should be as follow [x1_begin, x2_begin…​x1_end, x2_end,…​], where xi_begin is the number of pixels added at the beginning of axis <tt>i</tt> and xi_end is the number of pixels added at the end of axis <tt>i</tt>. If not present, the padding defaults to 0 along start and end of each spatial axis.<br/> <tt>strides : list of ints</tt> — 1-dimensional tensor with stride value along each spatial axis. If not present, the stride defaults to 1 along each spatial axis.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_e2278618-383d-63f4-970d-b48d86061576"><p id="_bf2500cd-25ef-fcf0-f01c-f85660bbd7d5"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input and output types to all numeric tensor types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_a7f4d185-f382-12b8-06d7-b5372884e980"><p id="_c62245e6-316f-7dcd-4dc6-0426c9f5363f"><tt>test_col2im</tt>, <tt>test_col2im_5d</tt>, <tt>test_col2im_dilations</tt>, <tt>test_col2im_pads</tt>, <tt>test_col2im_strides</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_7e7052e6-8588-95aa-1cfb-b7b752595ed9"><p id="_0daa6de6-e86c-9d75-736f-868f43b5db5c">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_7ab95753-3fe7-3230-d81a-12a5982d1459" anchor="op-ai-onnx-default-compress" obligation="normative">
<title id="_9f8430ea-54da-1e8e-463f-8a3bf7c1176d">Compress</title>
<p id="_47a0e7cc-3cea-c03f-3282-8c05fd5b6d2d">Selects slices from an input tensor along a given axis where condition evaluates to True for each axis index.     In case axis is not provided, input is flattened before elements are selected.     Compress behaves like numpy.compress:  <link target="https://docs.scipy.org/doc/numpy/reference/generated/numpy.compress.html"/></p>

<dl id="_64a36068-9574-8a43-e516-4ff58121b2d8"><dt>Domain</dt>
<dd id="_2fc8b31b-a854-aaa9-a324-da89d573f1d9"><p id="_46827e70-9353-115f-b62f-d97472e48224"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_551aaf19-9718-7311-e05f-840319aeceb1"><p id="_5dc7b9d3-deea-072e-e09f-9a8851cf3676">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_86b34a4c-d4b8-5b8d-b046-012b57878af7"><p id="_4030a485-fe07-e858-7001-5d7c2796f015">9, 11</p>
</dd>
<dt>Inputs</dt>
<dd id="_40035b66-45fb-2aa0-b07b-835e0905e0c8"><p id="_ab217ad3-a47f-67c1-55eb-2306150aeee5"><tt>input (differentiable) : T</tt> — Tensor of rank r &gt;= 1.<br/> <tt>condition (non-differentiable) : T1</tt> — Rank 1 tensor of booleans to indicate which slices or data elements to be selected. Its length can be less than the input length along the axis or the flattened input size if axis is not specified. In such cases data slices or elements exceeding the condition length are discarded.</p>
</dd>
<dt>Outputs</dt>
<dd id="_099cf310-d427-7707-3cc7-70bb369b7581"><p id="_355df559-b8a3-78a2-f4f6-9b89f454819a"><tt>output (differentiable) : T</tt> — Tensor of rank r if axis is specified. Otherwise output is a Tensor of rank 1.</p>
</dd>
<dt>Attributes</dt>
<dd id="_b3721326-8e18-ebb9-d22e-1a7bd8f87aa4"><p id="_f0839765-948d-2d27-911d-8f32f6ded5b6"><tt>axis : int</tt> — (Optional) Axis along which to take slices. If not specified, input is flattened before elements being selected. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(input).</p>
</dd>
<dt>Type constraints</dt>
<dd id="_a4be97be-a0b7-b76d-f656-64b10a998f0f"><p id="_bd0a415c-24bb-c947-d340-3245f99c2681"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input and output types to all tensor types.<br/> <tt>T1 : tensor(bool)</tt> — Constrain to boolean tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_d3f308f6-d694-a51a-29a2-84525b83c275"><p id="_3abc6d39-3825-4ecd-8de1-a6588fdc4691"><tt>test_compress_0</tt>, <tt>test_compress_1</tt>, <tt>test_compress_bfloat16</tt>, <tt>test_compress_default_axis</tt>, <tt>test_compress_negative_axis</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_ba4d2702-d198-1a73-6757-9a1dd029a2a5"><p id="_001e3508-de47-3a72-f28a-bf7ce599c1e6">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_9f71ced6-081d-75c0-22fd-af60bcc6d5a1" anchor="op-ai-onnx-default-concat" obligation="normative">
<title id="_88666e56-f13b-72d6-e56d-4e28c969495b">Concat</title>
<p id="_c4e89804-31db-ebf4-590c-7993f6731963">Concatenate a list of tensors into a single tensor. All input tensors must have the same shape, except for the dimension size of the axis to concatenate on.</p>

<dl id="_b438689a-3210-e844-ef2f-6ea502830cf8"><dt>Domain</dt>
<dd id="_ee7edc20-56a1-fea5-8824-8a0fb5537c7f"><p id="_43c97007-c309-6b18-456a-f7c1579799b2"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_442edfbf-88f7-716f-927c-7c7324ce3336"><p id="_3d2bff76-bd6e-83f7-25e8-eefa6af5ba2e">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_78290cf1-f8d8-5e34-3df4-8635333015d7"><p id="_ecd4cf83-dc9d-5395-7934-687568cd5145">1, 4, 11</p>
</dd>
<dt>Inputs (1 — unbounded)</dt>
<dd id="_a4071f9b-ad3c-9007-bc50-54e28bae4665"><p id="_ec3cca1e-ee78-1f17-2621-ee50773a8709"><tt>inputs (variadic, differentiable) : T</tt> — List of tensors for concatenation</p>
</dd>
<dt>Outputs</dt>
<dd id="_f6e15de5-5558-58a1-ea64-cbcb40241b05"><p id="_61de1f6d-4c7d-4416-3776-5257a14f2097"><tt>concat_result (differentiable) : T</tt> — Concatenated tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_91f2e99e-70bb-ae5b-a5e2-4d070fad0a62"><p id="_c4c24ee2-0544-ca35-7293-057ca958d4d2"><tt>axis : int (required)</tt> — Which axis to concat on. A negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(inputs)..</p>
</dd>
<dt>Type constraints</dt>
<dd id="_e3f59d30-b723-729c-b29e-8a72ef36c12a"><p id="_b689959e-d0f4-9e21-53d2-7ca0ee1dfaab"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain output types to any tensor type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_bb1911b0-6266-fdba-780c-e8d6f3f5f214"><p id="_6df53056-cb95-3a4e-6031-387d0f8177ff"><tt>test_concat_</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_56cfa73d-ae53-0cd3-6d7b-36aead361e9a"><p id="_285cfd45-ac40-544b-a950-62220b1cc0a1">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_1e265d9c-9b2c-40f0-3cef-51a4a5e509a6" anchor="op-ai-onnx-default-concatfromsequence" obligation="normative">
<title id="_c2220773-5957-6c83-5586-6b4ae284e60d">ConcatFromSequence</title>
<p id="_de1c9558-2215-4371-8dea-3f6d6d5f0f6c">Concatenate a sequence of tensors into a single tensor. All input tensors must have the same shape, except for the dimension size of the axis to concatenate on. By default ‘new_axis’ is 0, the behavior is similar to numpy.concatenate. When ‘new_axis’ is 1, the behavior is similar to numpy.stack.</p>

<dl id="_21b30d61-b367-f4a2-5d38-d8253ab0d673"><dt>Domain</dt>
<dd id="_b416f9bc-1ae4-ed53-ab26-41e54c5111a0"><p id="_9f70ae39-51e6-f27a-9637-14587c96b087"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_921f4370-244b-0e70-05b0-a91a63a4eb91"><p id="_4870aa29-eec0-f062-5493-99fca73bd25e">11</p>
</dd>
<dt>Inputs</dt>
<dd id="_394eafc2-9b51-26e5-de9c-bc960df07c83"><p id="_0a7cab53-6ccf-92e4-d414-d421e9dc05ae"><tt>input_sequence : S</tt> — Sequence of tensors for concatenation</p>
</dd>
<dt>Outputs</dt>
<dd id="_aed573ba-34eb-266d-99db-49f5fbde5d0b"><p id="_3d227b88-c07a-1341-c5e0-8471646be58b"><tt>concat_result : T</tt> — Concatenated tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_a67db33a-7c03-555a-f0f1-0ea545fa19ac"><p id="_12da21b0-3f86-57e5-dc67-4dae91632b36"><tt>axis : int (required)</tt> — Which axis to concat on. Accepted range in <tt>[-r, r - 1]</tt>, where <tt>r</tt> is the rank of input tensors. When <tt>new_axis</tt> is 1, accepted range is <tt>[-r - 1, r]</tt>.<br/> <tt>new_axis : int (default is 0)</tt> — Insert and concatenate on a new axis or not, default 0 means do not insert new axis.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_64318833-482c-37e4-1439-af1f640b25e3"><p id="_0f95ec7e-2da2-e114-44b3-d240bd6a9b7d"><tt>S : seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128))</tt> — Constrain input types to any tensor type.<br/> <tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain output types to any tensor type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_1852b40c-d5cb-6e90-0a13-4c52eecf88e3"><p id="_9f96788c-21f3-77c4-fae5-bf476c8a1344">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_b162947c-d9b7-d904-57de-057f082b413c"><p id="_5307b30d-2b70-da76-2c7c-b75db64e6bab">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_da598a73-2069-26a7-809f-8f6e1ac16ecc" anchor="op-ai-onnx-default-constant" obligation="normative">
<title id="_224f9976-c1f2-780a-2069-e30644ea2b4e">Constant</title>
<p id="_ab072c37-d847-e50c-59a1-d5ba9f91421a">This operator produces a constant tensor. Exactly one of the provided attributes, either value, sparse_value, or value_* must be specified.</p>

<dl id="_a733fc98-fe3c-3639-13b5-ca04459af183"><dt>Domain</dt>
<dd id="_4e5f1e8a-1d1a-16e8-2388-62e057f6f9db"><p id="_80f80524-4b30-6b49-c11e-b9da7e4cf169"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_bd8fbe07-c754-fe75-da1a-0e7dd4ab65f7"><p id="_0a494be9-8880-c60c-bf90-0463110cbd3d">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_dd138449-40d5-0356-c85e-d07aa810ef5b"><p id="_554cf1d9-fd08-e922-74f5-2607c10ca4da">1, 9, 11, 12, 13, 19, 21, 23, 24</p>
</dd>
<dt>Inputs</dt>
<dd id="_fbc40b63-2177-46db-e18f-4c88400d5b9a"><p id="_e0ff711a-3a7a-b124-9cf9-f0f2c51b739f">None.</p>
</dd>
<dt>Outputs</dt>
<dd id="_26a26fbe-0fac-d974-54a2-db635968e20e"><p id="_ab78ca06-b726-f902-5c0c-ddc767bb8998"><tt>output : T</tt> — Output tensor containing the same value of the provided tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_0cf6de24-f7e0-fe99-9246-0275c0655445"><p id="_3f6914ec-a609-54d4-7d36-da5fa71b412c"><tt>sparse_value : sparse_tensor</tt> — The value for the elements of the output tensor in sparse format.<br/> <tt>value : tensor</tt> — The value for the elements of the output tensor.<br/> <tt>value_float : float</tt> — The value for the sole element for the scalar, float32, output tensor.<br/> <tt>value_floats : list of floats</tt> — The values for the elements for the 1D, float32, output tensor.<br/> <tt>value_int : int</tt> — The value for the sole element for the scalar, int64, output tensor.<br/> <tt>value_ints : list of ints</tt> — The values for the elements for the 1D, int64, output tensor.<br/> <tt>value_string : string</tt> — The value for the sole element for the scalar, UTF-8 string, output tensor.<br/> <tt>value_strings : list of strings</tt> — The values for the elements for the 1D, UTF-8 string, output tensor.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_251cd309-eb56-7161-b487-162acc3408a7"><p id="_160d8b85-fe91-c229-8bf1-6315b8f8fb1c"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2)</tt> — Constrain input and output types to all tensor types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_38b6bb1e-a3cb-a6c9-dc36-6de8948dab95"><p id="_3f1ed01b-4686-591b-8609-3e23d826a5be"><tt>test_constant</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_e7a1ff93-7eae-b0a6-cc10-89def1d33468"><p id="_5f1f176c-d930-2287-cbf3-b2bf8924420d">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_0b3b8e32-d88a-5492-e9dc-76c557f165c0" anchor="op-ai-onnx-default-constantofshape" obligation="normative">
<title id="_f89f0adb-03db-a765-0614-246433ca9797">ConstantOfShape</title>
<p id="_3382d927-c180-9791-f5b3-6162a58abd14">Generate a tensor with given value and shape.</p>

<dl id="_233b2f19-1ac5-5af9-54f8-6b6d2704d8f6"><dt>Domain</dt>
<dd id="_9e7e6746-ceec-7de7-947e-987dcedc76dd"><p id="_ab4a2713-5cc9-d221-719e-ee2b95165fae"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_cfcfd999-8b26-0634-6282-4c32afaa6547"><p id="_d92899c1-7dc5-131c-1ae0-e782d07ad2a4">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_187e3c3f-aa4d-b72e-6ae6-76d7d457cf8e"><p id="_d6864e6f-363c-8582-f522-94065dd3c5e7">9, 20, 21, 23, 24</p>
</dd>
<dt>Inputs</dt>
<dd id="_c0677299-52e7-7f0d-4075-825b2d09d3e6"><p id="_2ebb7d7f-c44b-cef3-99cd-3953f9708d58"><tt>input : T1</tt> — 1D tensor. The shape of the expected output tensor. If empty tensor is given, the output would be a scalar. All values must be &gt;= 0.</p>
</dd>
<dt>Outputs</dt>
<dd id="_2630cba3-939b-d980-cf57-2058dfdd79be"><p id="_cdfb1ce2-1484-0b23-5270-10a62a5ba21e"><tt>output : T2</tt> — Output tensor of shape specified by ‘input’.If attribute ‘value’ is specified, the value and datatype of the output tensor is taken from ‘value’.If attribute ‘value’ is not specified, the value in the output defaults to 0, and the datatype defaults to float32.</p>
</dd>
<dt>Attributes</dt>
<dd id="_b9145906-2ab7-241d-53d7-b0c52657cc0f"><p id="_f96f1cfa-1006-a04a-761b-f6eb3a06ec6d"><tt>value : tensor</tt> — (Optional) The value of the output elements.Should be a one-element tensor. If not specified, it defaults to a tensor of value 0 and datatype float32</p>
</dd>
<dt>Type constraints</dt>
<dd id="_0f1da1cb-62b9-432f-9652-06ff46a74289"><p id="_6ba1e574-8db1-f27b-dfb8-bbbf8a8c897f"><tt>T1 : tensor(int64)</tt> — Constrain input types.<br/> <tt>T2 : tensor(float16), tensor(float), tensor(double), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint4), tensor(int4), tensor(bool), tensor(bfloat16), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2)</tt> — Constrain output types to be numerics or boolean.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_2e25e847-a1f4-ea53-90e2-93b350f0b9a1"><p id="_adbd3663-3372-9613-78fa-31e023fca8cc"><tt>test_constantofshape_float_ones</tt>, <tt>test_constantofshape_int_shape_zero</tt>, <tt>test_constantofshape_int_zeros</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_f6ef0f6f-ed02-ce2f-713e-4514bd13f6f5"><p id="_d050a81e-9539-6905-a784-727628a4d5fd">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_1c99045f-0463-1247-0908-679c9e223214" anchor="op-ai-onnx-default-conv" obligation="normative">
<title id="_124be877-1ec8-f0b1-69ec-e33f41502ee1">Conv</title>
<p id="_47d884a6-edb8-7dde-dc1d-04e379a392fc">The convolution operator consumes an input tensor and a filter, and computes the output.</p>

<dl id="_c822f5cf-e924-6259-cca1-f189fa643d72"><dt>Domain</dt>
<dd id="_d48fca67-e955-a3ee-77f9-7a1eda3a299a"><p id="_cd5c9f09-ee3f-beea-016f-5eb0baeba634"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_c15a36b3-d3de-c189-192b-3ad46c1bf41b"><p id="_7b6eb9d3-0e1d-854e-e590-337e7eb6e51b">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_3f20aa60-ea07-a207-afc1-28b39bfc90c1"><p id="_8208263e-6c00-5a6e-3437-8c83edb663e1">1, 11</p>
</dd>
<dt>Inputs (2 — 3)</dt>
<dd id="_0eb8818f-ae3f-0f39-8693-0e8f1a7dcda7"><p id="_473423f8-a166-6eb5-459d-9c1b05f814fa"><tt>X (differentiable) : T</tt> — Input data tensor from previous layer; has size (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and width. Note that this is for the 2D image. Otherwise the size is (N x C x D1 x D2 …​ x Dn). Optionally, if dimension denotation is in effect, the operation expects input data tensor to arrive with the dimension denotation of [DATA_BATCH, DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE …​].<br/> <tt>W (differentiable) : T</tt> — The weight tensor that will be used in the convolutions; has size (M x C/group x kH x kW), where C is the number of channels, and kH and kW are the height and width of the kernel, and M is the number of feature maps. For more than 2 dimensions, the kernel shape will be (M x C/group x k1 x k2 x …​ x kn), where (k1 x k2 x …​ kn) is the dimension of the kernel. Optionally, if dimension denotation is in effect, the operation expects the weight tensor to arrive with the dimension denotation of [FILTER_OUT_CHANNEL, FILTER_IN_CHANNEL, FILTER_SPATIAL, FILTER_SPATIAL …​]. Assuming zero based indices for the shape array, X.shape[1] == (W.shape[1] * group) == C and W.shape[0] mod G == 0. Or in other words FILTER_IN_CHANNEL multiplied by the number of groups should be equal to DATA_CHANNEL and the number of feature maps M should be a multiple of the number of groups G.<br/> <tt>B (optional, differentiable) : T</tt> — Optional 1D bias to be added to the convolution, has size of M.</p>
</dd>
<dt>Outputs</dt>
<dd id="_fc830cca-93a3-cd23-5671-97fcaa5e34bc"><p id="_d73b2009-9308-71b5-644f-74a50a69688a"><tt>Y (differentiable) : T</tt> — Output data tensor that contains the result of the convolution. The output dimensions are functions of the kernel size, stride size, and pad lengths.</p>
</dd>
<dt>Attributes</dt>
<dd id="_fe5b4cae-e5de-cda9-9e9f-53b3d9d809b4"><p id="_6e888ab5-52c1-780a-16db-66e40555a537"><tt>auto_pad : string (default is NOTSET)</tt> — auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID. Where default value is NOTSET, which means explicit padding is used. SAME_UPPER or SAME_LOWER mean pad the input so that <tt>output_shape[i] = ceil(input_shape[i] / strides[i])</tt> for each axis <tt>i</tt>. The padding is split between the two sides equally or almost equally (depending on whether it is even or odd). In case the padding is an odd number, the extra padding is added at the end for SAME_UPPER and at the beginning for SAME_LOWER.<br/> <tt>dilations : list of ints</tt> — dilation value along each spatial axis of the filter. If not present, the dilation defaults is 1 along each spatial axis.<br/> <tt>group : int (default is 1)</tt> — number of groups input channels and output channels are divided into.<br/> <tt>kernel_shape : list of ints</tt> — The shape of the convolution kernel. If not present, should be inferred from input W.<br/> <tt>pads : list of ints</tt> — Padding for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis. <tt>pads</tt> format should be as follow [x1_begin, x2_begin…​x1_end, x2_end,…​], where xi_begin the number of pixels added at the beginning of axis <tt>i</tt> and xi_end, the number of pixels added at the end of axis <tt>i</tt>. This attribute cannot be used simultaneously with auto_pad attribute. If not present, the padding defaults to 0 along start and end of each spatial axis.<br/> <tt>strides : list of ints</tt> — Stride along each spatial axis. If not present, the stride defaults is 1 along each spatial axis.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_08a2fc70-2fbe-9a1e-d38f-c8370870a76b"><p id="_920b3def-c6d9-6798-6b5e-b82c076ea860"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_ee74320f-c4b2-f64a-8663-209d3fbb3074"><p id="_9bc23ee2-3764-c478-cef1-c0076e18dedc"><tt>test_basic_conv_with_padding</tt>, <tt>test_basic_conv_without_padding</tt>, <tt>test_conv_with_autopad_same</tt>, <tt>test_conv_with_strides_padding</tt>, <tt>test_conv_with_strides_no_padding</tt>, <tt>test_conv_with_strides_and_asymmetric_padding</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_5d19f159-7df0-f60c-caf1-9ed80a0c46a9"><p id="_11c2a056-81e1-d471-8b73-03fe19c211b4">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_3c1356b4-83e1-e5ba-9a47-ec9e5808cb81" anchor="op-ai-onnx-default-convinteger" obligation="normative">
<title id="_31a7488e-4ae5-e49f-52d4-95dfe2b9a264">ConvInteger</title>
<p id="_31d1e950-1fb3-40e1-90ae-3c91dc112877">The integer convolution operator consumes an input tensor, its zero-point, a filter, and its zero-point, and computes the output. The production MUST never overflow. The accumulation may overflow if and only if in 32 bits.</p>

<dl id="_a64bb232-c622-6367-fec5-cafeefd63df2"><dt>Domain</dt>
<dd id="_3d1a8de7-fb9c-9b96-8df6-20e87e39a7fb"><p id="_bd875e83-d684-32ab-babe-96ffadee995e"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_065252a5-559c-2047-c7c6-6e7e719782e0"><p id="_4e9846f4-99a1-dd63-ce63-22a00e14699e">10</p>
</dd>
<dt>Inputs (2 — 4)</dt>
<dd id="_dc7e4cc4-a232-460b-1a50-5d3c259b8199"><p id="_ffcfebf3-77a3-2f78-7f76-587a5088f653"><tt>x : T1</tt> — Input data tensor from previous layer; has size (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and width. Note that this is for the 2D image. Otherwise the size is (N x C x D1 x D2 …​ x Dn). Optionally, if dimension denotation is in effect, the operation expects input data tensor to arrive with the dimension denotation of [DATA_BATCH, DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE …​].<br/> <tt>w : T2</tt> — The weight tensor that will be used in the convolutions; has size (M x C/group x kH x kW), where C is the number of channels, and kH and kW are the height and width of the kernel, and M is the number of feature maps. For more than 2 dimensions, the kernel shape will be (M x C/group x k1 x k2 x …​ x kn), where (k1 x k2 x …​ kn) is the dimension of the kernel. Optionally, if dimension denotation is in effect, the operation expects the weight tensor to arrive with the dimension denotation of [FILTER_OUT_CHANNEL, FILTER_IN_CHANNEL, FILTER_SPATIAL, FILTER_SPATIAL …​]. X.shape[1] == (W.shape[1] * group) == C (assuming zero based indices for the shape array). Or in other words FILTER_IN_CHANNEL should be equal to DATA_CHANNEL.<br/> <tt>x_zero_point (optional) : T1</tt> — Zero point tensor for input ‘x’. It’s optional and default value is 0. It’s a scalar, which means a per-tensor/layer quantization.<br/> <tt>w_zero_point (optional) : T2</tt> — Zero point tensor for input ‘w’. It’s optional and default value is 0. It could be a scalar or a 1-D tensor, which means a per-tensor/layer or per output channel quantization. If it’s a 1-D tensor, its number of elements should be equal to the number of output channels (M)</p>
</dd>
<dt>Outputs</dt>
<dd id="_5e18e40b-16fd-ffd9-a309-0cdd2ecf41e8"><p id="_e86dc34d-26a9-7e72-56b2-8eb839771d26"><tt>y : T3</tt> — Output data tensor that contains the result of the convolution. The output dimensions are functions of the kernel size, stride size, and pad lengths.</p>
</dd>
<dt>Attributes</dt>
<dd id="_096a7c62-53b5-3eda-37c2-0f58b2bca42a"><p id="_080fdb52-ac04-0759-4fd9-aadeef925d46"><tt>auto_pad : string (default is NOTSET)</tt> — auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID. Where default value is NOTSET, which means explicit padding is used. SAME_UPPER or SAME_LOWER mean pad the input so that <tt>output_shape[i] = ceil(input_shape[i] / strides[i])</tt> for each axis <tt>i</tt>. The padding is split between the two sides equally or almost equally (depending on whether it is even or odd). In case the padding is an odd number, the extra padding is added at the end for SAME_UPPER and at the beginning for SAME_LOWER.<br/> <tt>dilations : list of ints</tt> — dilation value along each spatial axis of the filter. If not present, the dilation defaults to 1 along each axis.<br/> <tt>group : int (default is 1)</tt> — number of groups input channels and output channels are divided into. default is 1.<br/> <tt>kernel_shape : list of ints</tt> — The shape of the convolution kernel. If not present, should be inferred from input ‘w’.<br/> <tt>pads : list of ints</tt> — Padding for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0.The value represent the number of pixels added to the beginning and end part of the corresponding axis.<tt>pads</tt> format should be as follow [x1_begin, x2_begin…​x1_end, x2_end,…​], where xi_begin the number ofpixels added at the beginning of axis <tt>i</tt> and xi_end, the number of pixels added at the end of axis <tt>i</tt>.This attribute cannot be used simultaneously with auto_pad attribute. If not present, the padding defaultsto 0 along start and end of each spatial axis.<br/> <tt>strides : list of ints</tt> — Stride along each spatial axis. If not present, the stride defaults to 1 along each axis.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_7b7047ec-70e6-de64-0c3a-84254e655230"><p id="_1eb5dbb7-0862-06e3-a173-44fe66154b0d"><tt>T1 : tensor(int8), tensor(uint8)</tt> — Constrain input x and its zero point data type to 8-bit integer tensor.<br/> <tt>T2 : tensor(int8), tensor(uint8)</tt> — Constrain input w and its zero point data type to 8-bit integer tensor.<br/> <tt>T3 : tensor(int32)</tt> — Constrain output y data type to 32-bit integer tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_bde8081d-ab8d-0dbe-1657-35bd8babcb54"><p id="_fbdacf26-eb1e-28fb-47d1-a99c649d999e"><tt>test_convinteger_with_padding</tt>, <tt>test_convinteger_without_padding</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_1997a851-0cd3-10e3-790d-d64df27de437"><p id="_fbd1af24-907c-7492-01f1-e33423360ef8">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_9be88499-7b23-59d2-c123-ebbcc4daa2a3" anchor="op-ai-onnx-default-convtranspose" obligation="normative">
<title id="_1932d6eb-1de7-e9aa-623f-540b434905e6">ConvTranspose</title>
<p id="_b3759051-15d5-9bee-e2fb-e598e8b1c81b">The convolution transpose operator consumes an input tensor and a filter, and computes the output.</p>

<p id="_f0952d37-4a05-766e-80e4-1b8b87e5a9e7">If the pads parameter is provided the shape of the output is calculated via the following equation:</p>

<p id="_6e9c5be0-d7b5-e76b-b772-1515503ae933">output_shape[i] = stride[i] * (input_size[i] — 1) + output_padding[i] + ((kernel_shape[i] — 1) * dilations[i] + 1) — pads[start_i] — pads[end_i]</p>

<p id="_b417dce6-6355-c06d-4ea4-2321e9a36d84">output_shape can also be explicitly specified in which case pads values are auto generated using these equations:</p>

<p id="_43de045d-7281-f108-7ccd-97dd4b14c550">total_padding[i] = stride[i] * (input_size[i] — 1) + output_padding[i] + ((kernel_shape[i] — 1) * dilations[i] + 1) — output_shape[i]   If (auto_pads == SAME_UPPER): pads[start_i] = total_padding[i]/2; pads[end_i] = total_padding[i] — (total_padding[i]/2)   Else: pads[start_i] = total_padding[i] — (total_padding[i]/2); pads[end_i] = (total_padding[i]/2).</p>

<dl id="_2cba75b0-c949-1c63-6116-a3c0e80fad93"><dt>Domain</dt>
<dd id="_fdbee11f-fcfb-a897-b3f9-aad2a3ee38a4"><p id="_096cd052-7b99-37df-489c-80bc9c1ed703"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_a5b89c98-e19a-42c3-71c9-dd12d5a9fd95"><p id="_b206cfc9-5dfc-123b-a54f-2d916455a086">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_946f4085-e117-01c4-25a5-c655f646ceba"><p id="_5480a709-8e43-615d-c0e5-6e6aad420c36">1, 11</p>
</dd>
<dt>Inputs (2 — 3)</dt>
<dd id="_00ec9c80-2ad4-a082-4c38-e1e7b0571c87"><p id="_6d19e65b-39ca-5099-ab68-cbc804704b4d"><tt>X (differentiable) : T</tt> — Input data tensor from previous layer; has size (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and width. Note that this is for the 2D image. Otherwise the size is (N x C x D1 x D2 …​ x Dn)<br/> <tt>W (differentiable) : T</tt> — The weight tensor that will be used in the convolutions; has size (C x M/group x kH x kW), where C is the number of channels, and kH and kW are the height and width of the kernel, and M is the number of feature maps. For more than 2 dimensions, the weight shape will be (C x M/group x k1 x k2 x …​ x kn), where (k1 x k2 x …​ x kn) is the dimension of the kernel. The number of channels in the output should be equal to W.shape[1] * group (assuming zero based indices of the shape array)<br/> <tt>B (optional, differentiable) : T</tt> — Optional 1D bias to be added to the convolution, has size of M.</p>
</dd>
<dt>Outputs</dt>
<dd id="_eaaec02d-a618-4b7c-7fb5-be5f4a095c68"><p id="_e2fe01a1-f698-12e3-758c-2ffbe0e6628a"><tt>Y (differentiable) : T</tt> — Output data tensor that contains the result of the convolution. The output dimensions are functions of the kernel size, stride size, pad lengths and group count. The number of channels in the output should be equal to W.shape[1] * group (assuming zero based indices of the shape array)</p>
</dd>
<dt>Attributes</dt>
<dd id="_bdf1aa41-c360-b91b-79b7-6b9e1f49abc9"><p id="_687eb883-d3e4-4813-4e28-726ffc065852"><tt>auto_pad : string (default is NOTSET)</tt> — auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID. Where default value is NOTSET, which means explicit padding is used. SAME_UPPER or SAME_LOWER mean pad the input so that <tt>output_shape[i] = input_shape[i] * strides[i]</tt> for each axis <tt>i</tt>. The padding is split between the two sides equally or almost equally (depending on whether it is even or odd). In case the padding is an odd number, the extra padding is added at the end for SAME_UPPER and at the beginning for SAME_LOWER.<br/> <tt>dilations : list of ints</tt> — dilation value along each spatial axis of the filter. If not present, the dilation defaults to 1 along each spatial axis.<br/> <tt>group : int (default is 1)</tt> — number of groups input channels and output channels are divided into.<br/> <tt>kernel_shape : list of ints</tt> — The shape of the convolution kernel. If not present, should be inferred from input W.<br/> <tt>output_padding : list of ints</tt> — Additional elements added to the side with higher coordinate indices in the output. Each padding value in “output_padding” must be less than the corresponding stride/dilation dimension. By default, this attribute is a zero vector. Note that this attribute doesn’t directly affect the computed output values. It only controls the selection of the computed values, so changing this attribute only adds or removes output elements. If “output_shape” is explicitly provided, “output_padding” does not contribute additional size to “output_shape” but participates in the computation of the needed padding amount. This is also called adjs or adjustment in some frameworks.<br/> <tt>output_shape : list of ints</tt> — The shape of the output can be explicitly set which will cause pads values to be auto generated. If output_shape is specified pads values are ignored. See doc for details for equations to generate pads. Note that the output_shape attribute value should not include dimensions for batch size and channels, which are automatically inferred.<br/> <tt>pads : list of ints</tt> — Padding for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis. <tt>pads</tt> format should be as follow [x1_begin, x2_begin…​x1_end, x2_end,…​], where xi_begin the number of pixels added at the beginning of axis <tt>i</tt> and xi_end, the number of pixels added at the end of axis <tt>i</tt>. This attribute cannot be used simultaneously with auto_pad attribute. If not present, the padding defaults to 0 along start and end of each spatial axis.<br/> <tt>strides : list of ints</tt> — Stride along each spatial axis. If not present, the stride defaults to 1 along each spatial axis.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_03be99e6-b1fa-c676-7d7c-b5023f59dc36"><p id="_849c23ab-14b1-c736-7e83-cc05942b96c2"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_d8090417-cd5d-a623-863b-e086b14b150b"><p id="_783d7aea-8813-54f9-a33c-34b30698a119"><tt>test_convtranspose</tt>, <tt>test_convtranspose_1d</tt>, <tt>test_convtranspose_3d</tt>, <tt>test_convtranspose_output_shape</tt>, <tt>test_convtranspose_pad</tt>, <tt>test_convtranspose_kernel_shape</tt>, <tt>test_convtranspose_autopad_same</tt>, <tt>test_convtranspose_dilations</tt>, <tt>test_convtranspose_group_2</tt>, <tt>test_convtranspose_group_2_image_3</tt>, <tt>test_convtranspose_pads</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_c0205a3e-4bab-ebdd-db97-bc15d6d7ad6b"><p id="_c2b75277-310a-0843-9879-d94cbdf6f386">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_e5997cc8-8962-b9cd-5d72-1cd7a6263149" anchor="op-ai-onnx-default-cos" obligation="normative">
<title id="_46bb0421-59aa-410d-42cb-f038cd97faeb">Cos</title>
<p id="_c5f13e9a-ae93-e1a3-c418-4fe322f09484">Calculates the cosine of the given input tensor, element-wise.</p>

<dl id="_277faa7d-9999-0cbb-0753-7da751848366"><dt>Domain</dt>
<dd id="_fbddf024-1ad1-4d2a-f8d6-48cc63c9185c"><p id="_f9c1ac76-d292-0a03-ed5c-693b88b81989"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_0b786e74-81a9-0da7-93f7-18a2d7eeca23"><p id="_105ea7f2-a61e-25e0-918f-9233fbaff02c">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_febc0ad5-b599-c5d3-9682-6b673b709edd"><p id="_7df1632e-9d4d-2f04-f16b-469a1c3cfd51">7</p>
</dd>
<dt>Inputs</dt>
<dd id="_2291eb39-dcb6-b971-f0d3-2df8f5125929"><p id="_1bea04f0-a908-7c5f-7bac-33da532beadc"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_a05a885e-85c8-ecc5-8f15-67a456f46015"><p id="_997d8d65-d88d-9513-4725-990064cac62b"><tt>output (differentiable) : T</tt> — The cosine of the input tensor computed element-wise</p>
</dd>
<dt>Attributes</dt>
<dd id="_1b84b09a-9e17-3a33-7f08-210be29f6e89"><p id="_ded95fe6-fb03-d174-48b6-67740221bd7f">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_ce74f9b0-320a-f419-aeca-9ff9eb7948a8"><p id="_c16f601f-fa34-2960-6bec-c15b76f23190"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_1d44f4ca-ab06-617f-b619-c414b43d7f98"><p id="_dccda9b7-e4d4-f018-0a1e-c55eeb941d0c"><tt>test_cos_example</tt>, <tt>test_cos</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_61b11a68-ae10-c6c1-8113-e289274bb3c0"><p id="_bcf871fd-a3ed-2446-e288-98b09a933cef">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_a2ff5ff3-fcf4-c814-115a-0e2931d12597" anchor="op-ai-onnx-default-cosh" obligation="normative">
<title id="_641080bc-e1d4-f578-aed9-543b3ecb98a2">Cosh</title>
<p id="_34ca8dcd-7cd7-adcd-c20f-12696123a2a2">Calculates the hyperbolic cosine of the given input tensor element-wise.</p>

<dl id="_ffac778c-8c56-74d2-5a25-fc1462e829d4"><dt>Domain</dt>
<dd id="_f22cef55-5cc0-3396-62a3-696d07ef8a77"><p id="_5547b7e3-9023-ea63-f2bc-015acf306e16"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_946d7448-6887-d197-5c31-b560a1d1096b"><p id="_d67d20ce-b2cf-9fd4-eb7c-336563173153">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_ddb9ca7b-1f4a-0058-3a09-0a443ad069ed"><p id="_0bdceacb-7cbb-dbda-6543-25e220b41f89">9</p>
</dd>
<dt>Inputs</dt>
<dd id="_0e6aad62-dfb8-01e9-740b-47f790757ad1"><p id="_0dc72b71-2002-c718-3293-16bd490cca70"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_a4e8dc5f-185a-65c9-3dca-335ac296c020"><p id="_b39837a3-aa3c-0899-397b-51e1a7e2edb1"><tt>output (differentiable) : T</tt> — The hyperbolic cosine values of the input tensor computed element-wise</p>
</dd>
<dt>Attributes</dt>
<dd id="_7b533357-94ad-13b1-3de4-607faddac5e8"><p id="_26462085-53fc-1848-8d08-cf01e18b675e">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_c57789d3-5f36-e7fe-6f76-ba0e688ec692"><p id="_58cbf615-b5c6-f7a3-5451-a4294771ba0d"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_d543e2f4-6ade-d92a-3ff3-2bbc734a0125"><p id="_e2e17c91-5301-487f-be01-83c46310d1ec"><tt>test_cosh_example</tt>, <tt>test_cosh</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_44a6ccce-bda0-6598-922c-193bef994c2a"><p id="_d9f55ddb-f5a6-ee2a-15f2-90dfa22144eb">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_6fceff69-5636-c837-19ce-d817ee5e305e" anchor="op-ai-onnx-default-cumprod" obligation="normative">
<title id="_f6668356-4d65-e00d-eb47-309e5249054c">CumProd</title>
<p id="_180959e5-5bff-d09c-67b9-5869def93252">Performs cumulative product of the input elements along the given axis. By default, it will do the product inclusively meaning the first element is copied as is. Through an  <tt>exclusive</tt> attribute, this behavior can change to exclude the first element. It can also perform product in the opposite direction of the axis. For that, set  <tt>reverse</tt> attribute to 1.</p>

<p id="_3579b085-b15b-86e2-413a-5c21bd1d1cd1">Example:</p>

<sourcecode id="_9582f04e-a4aa-1290-a085-e8478ab615b9" unnumbered="true"><body>input_x = [1, 2, 3]
axis=0
output = [1, 2, 6]
exclusive=1
output = [1, 1, 2]
exclusive=0
reverse=1
output = [6, 6, 3]
exclusive=1
reverse=1
output = [6, 3, 1]</body></sourcecode>


<dl id="_4bc70316-9df8-8606-dad6-5d6e34968c74"><dt>Domain</dt>
<dd id="_bbbe0445-426c-f32e-e145-10e7eec9d31e"><p id="_34e4d321-abbc-07af-b86f-8489213712ed"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_3a7632c6-0a59-2e68-05d6-eedd2e1afcb7"><p id="_8b73f79c-a9da-0b8e-38f5-a4fae73471ac">26</p>
</dd>
<dt>Inputs</dt>
<dd id="_7f8e7984-04a4-26f7-e703-2ac9963de331"><p id="_4f58b4d4-f852-0be9-5ba0-9b9a3e08037e"><tt>x (differentiable) : T</tt> — An input tensor that is to be processed.<br/> <tt>axis (non-differentiable) : T2</tt> — A 0-D tensor. Must be in the range [-rank(x), rank(x)-1]. Negative value means counting dimensions from the back.</p>
</dd>
<dt>Outputs</dt>
<dd id="_0db89647-1ad9-cf9b-3ed8-dc5765d8c42f"><p id="_b04c94e4-41b3-86a7-603d-adae43f62fe1"><tt>y (differentiable) : T</tt> — Output tensor of the same type as ‘x’ with cumulative products of the x’s elements</p>
</dd>
<dt>Attributes</dt>
<dd id="_3933b44c-8d82-e8c1-2b92-155f216e6507"><p id="_e9c2e3d5-8629-0b7f-ecef-5c75d42767af"><tt>exclusive : int (default is 0)</tt> — If set to 1 will return exclusive product in which the top element is not included. In other terms, if set to 1, the j-th output element would be the product of the first (j-1) elements. Otherwise, it would be the product of the first j elements.<br/> <tt>reverse : int (default is 0)</tt> — If set to 1 will perform the products in reverse direction.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_89bf681d-7eca-52ec-36c3-348b020365cd"><p id="_d1e220bf-1354-5e8a-f7c7-5f52152d73be"><tt>T : tensor(uint32), tensor(uint64), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to numeric tensors.<br/> <tt>T2 : tensor(int32), tensor(int64)</tt> — axis tensor can be int32 or int64 only</p>
</dd>
<dt>Test vectors</dt>
<dd id="_16401aa4-f0a5-cca6-ef79-7094956ae9fa"><p id="_252cf98d-8804-aa05-1721-f1b015bc471a"><tt>test_cumprod_1d</tt>, <tt>test_cumprod_1d_exclusive</tt>, <tt>test_cumprod_1d_int32_exclusive</tt>, <tt>test_cumprod_1d_reverse</tt>, <tt>test_cumprod_1d_reverse_exclusive</tt>, <tt>test_cumprod_2d_axis_0</tt>, <tt>test_cumprod_2d_axis_1</tt>, <tt>test_cumprod_2d_int32</tt>, <tt>test_cumprod_2d_negative_axis</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_d45d7f49-0d3b-39ea-4e69-4df869a6eefb"><p id="_97abf90c-106d-332c-9847-a4718aaca1c0">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_662a5702-dfc5-87c7-5382-115d71c47721" anchor="op-ai-onnx-default-cumsum" obligation="normative">
<title id="_5b2d8168-b3c0-f367-e894-2887ef41f4d5">CumSum</title>
<p id="_2ca99e5d-56ce-8810-163e-e4cb5396ed0a">Performs cumulative sum of the input elements along the given axis. By default, it will do the sum inclusively meaning the first element is copied as is. Through an  <tt>exclusive</tt> attribute, this behavior can change to exclude the first element. It can also perform summation in the opposite direction of the axis. For that, set  <tt>reverse</tt> attribute to 1.</p>

<p id="_86ce0358-3f13-9a7b-7ec4-1a9ef676aa20">Example:</p>

<sourcecode id="_65be15cc-691e-3a2d-1fc6-f4dce71eec2e" unnumbered="true"><body>input_x = [1, 2, 3]
axis=0
output = [1, 3, 6]
exclusive=1
output = [0, 1, 3]
exclusive=0
reverse=1
output = [6, 5, 3]
exclusive=1
reverse=1
output = [5, 3, 0]</body></sourcecode>


<dl id="_339852f1-7cbb-0e8a-da94-7b3f16975719"><dt>Domain</dt>
<dd id="_8111f6eb-1c89-74e4-8070-1f3aedf2d850"><p id="_500bb810-f440-2659-9ed6-6154c06adff1"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_9b4bcde2-e04f-4cef-b79d-947180d9b405"><p id="_f405a6d5-68b2-54d4-98ba-7f9e2ce4d5ff">14</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_73534126-4979-9650-35b8-e7e80222e29d"><p id="_ea76e4f7-3f43-117f-4d35-dff33c5fa667">11</p>
</dd>
<dt>Inputs</dt>
<dd id="_bc8c9ac1-ac04-9f9d-e518-aba33a56c2ae"><p id="_ab63cf60-7a3b-cc33-dc2b-487e3ffcb83f"><tt>x (differentiable) : T</tt> — An input tensor that is to be processed.<br/> <tt>axis (non-differentiable) : T2</tt> — A 0-D tensor. Must be in the range [-rank(x), rank(x)-1]. Negative value means counting dimensions from the back.</p>
</dd>
<dt>Outputs</dt>
<dd id="_5596dce5-98a4-449e-f29a-acc600b78362"><p id="_51b780b8-b877-923d-aa04-e061e59ddc60"><tt>y (differentiable) : T</tt> — Output tensor of the same type as ‘x’ with cumulative sums of the x’s elements</p>
</dd>
<dt>Attributes</dt>
<dd id="_1ff9f6fb-45a6-1295-c704-39d513657205"><p id="_1b32139c-68cf-d396-7b92-acbd09ac47eb"><tt>exclusive : int (default is 0)</tt> — If set to 1 will return exclusive sum in which the top element is not included. In other terms, if set to 1, the j-th output element would be the sum of the first (j-1) elements. Otherwise, it would be the sum of the first j elements.<br/> <tt>reverse : int (default is 0)</tt> — If set to 1 will perform the sums in reverse direction.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_90d86c8c-2b04-517e-3f8e-6e30e3cd0825"><p id="_2d801291-f71e-b0dd-e7f4-06e44e54ebbe"><tt>T : tensor(uint32), tensor(uint64), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to numeric tensors.<br/> <tt>T2 : tensor(int32), tensor(int64)</tt> — axis tensor can be int32 or int64 only</p>
</dd>
<dt>Test vectors</dt>
<dd id="_f1e9560e-4730-661d-3d7c-c836f6587036"><p id="_b1f455f7-2c69-7716-5313-792a50ecbc23"><tt>test_cumsum_1d</tt>, <tt>test_cumsum_1d_exclusive</tt>, <tt>test_cumsum_1d_int32_exclusive</tt>, <tt>test_cumsum_1d_reverse</tt>, <tt>test_cumsum_1d_reverse_exclusive</tt>, <tt>test_cumsum_2d_axis_0</tt>, <tt>test_cumsum_2d_axis_1</tt>, <tt>test_cumsum_2d_int32</tt>, <tt>test_cumsum_2d_negative_axis</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_19601c1c-71dc-2273-32c3-dc6e2351299a"><p id="_40c2e9c5-fd53-b419-0964-22e494e73122">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_715fa2b2-76fe-4b66-3d61-efccf5e326b3" anchor="op-ai-onnx-default-dft" obligation="normative">
<title id="_10d6e532-4dc3-4709-2143-c2524a9db625">DFT</title>
<p id="_5fe8f6ce-abc0-5c13-bff1-8573164c9210">Computes the discrete Fourier Transform (DFT) of the input.</p>

<p id="_724548e5-ed85-7f31-beeb-ffa15a923c65">Assuming the input has shape <tt>[M, N]</tt>, where <tt>N</tt> is the dimension over which the DFT is computed and  <tt>M</tt> denotes the conceptual “all other dimensions,” the DFT  <tt>y[m, k]</tt> of shape <tt>[M, N]</tt> is defined as</p>

<formula id="_6f4a39a9-b153-245b-9cb7-a9ccf77c9199"><stem block="true" type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML">
  <mstyle displaystyle="true">
    <mi>y</mi>
    <mrow>
      <mo>[</mo>
      <mi>m</mi>
      <mo>,</mo>
      <mi>k</mi>
      <mo>]</mo>
    </mrow>
    <mo>=</mo>
    <mo>\</mo>
    <mrow>
      <munderover>
        <mo>∑</mo>
        <mrow>
          <mi>n</mi>
          <mo>=</mo>
          <mn>0</mn>
        </mrow>
        <mrow>
          <mi>N</mi>
          <mo>−</mo>
          <mn>1</mn>
        </mrow>
      </munderover>
      <msup>
        <mi>e</mi>
        <mrow>
          <mo>−</mo>
          <mn>2</mn>
          <mo>\</mo>
          <mi>π</mi>
          <mi>j</mi>
          <mo>\</mo>
          <mfrac>
            <mrow>
              <mi>k</mi>
              <mi>n</mi>
            </mrow>
            <mi>N</mi>
          </mfrac>
        </mrow>
      </msup>
    </mrow>
    <mi>x</mi>
    <mrow>
      <mo>[</mo>
      <mi>m</mi>
      <mo>,</mo>
      <mi>n</mi>
      <mo>]</mo>
    </mrow>
    <mo>,</mo>
  </mstyle>
</math><asciimath>y[m, k] = \sum_{n=0}^{N-1} e^{-2 \pi j \frac{k n}{N} } x[m, n] ,</asciimath></stem></formula>

<p id="_73890836-12ca-a4bd-cd06-e431b7286213">and the inverse transform is defined as</p>

<formula id="_c4c27fb8-f45f-6d1b-4bd8-ba3cb314435a"><stem block="true" type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML">
  <mstyle displaystyle="true">
    <mi>x</mi>
    <mrow>
      <mo>[</mo>
      <mi>m</mi>
      <mo>,</mo>
      <mi>n</mi>
      <mo>]</mo>
    </mrow>
    <mo>=</mo>
    <mo>\</mo>
    <mfrac>
      <mn>1</mn>
      <mi>N</mi>
    </mfrac>
    <mo>\</mo>
    <mrow>
      <munderover>
        <mo>∑</mo>
        <mrow>
          <mi>k</mi>
          <mo>=</mo>
          <mn>0</mn>
        </mrow>
        <mrow>
          <mi>N</mi>
          <mo>−</mo>
          <mn>1</mn>
        </mrow>
      </munderover>
      <msup>
        <mi>e</mi>
        <mrow>
          <mn>2</mn>
          <mo>\</mo>
          <mi>π</mi>
          <mi>j</mi>
          <mo>\</mo>
          <mfrac>
            <mrow>
              <mi>k</mi>
              <mi>n</mi>
            </mrow>
            <mi>N</mi>
          </mfrac>
        </mrow>
      </msup>
    </mrow>
    <mi>y</mi>
    <mrow>
      <mo>[</mo>
      <mi>m</mi>
      <mo>,</mo>
      <mi>k</mi>
      <mo>]</mo>
    </mrow>
    <mo>,</mo>
  </mstyle>
</math><asciimath>x[m, n] = \frac{1}{N} \sum_{k=0}^{N-1} e^{2 \pi j \frac{k n}{N} } y[m, k] ,</asciimath></stem></formula>

<p id="_9f0145ca-493d-6a39-b235-3695fc5079f9">where $j$ is the imaginary unit.</p>

<p id="_7193d22a-a27b-bb84-5a84-bcc8b774289f">The actual shape of the output is specified in the “output” section.</p>

<p id="_eb7a0300-e9be-5b59-ace5-89a82b68e3be">Reference: <link target="https://docs.scipy.org/doc/scipy/tutorial/fft.html"/></p>

<dl id="_3262f066-25d8-7863-3b84-df3055538238"><dt>Domain</dt>
<dd id="_080f4bd7-b34d-69b0-c57e-ad397ab834c2"><p id="_bceeed53-0285-747b-96b6-fb7802ce7229"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_e3ad1118-50a3-4c1b-fb01-9fb98dc11b7e"><p id="_067763c1-8aa2-e47a-9370-94ad4b2b00de">20</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_83d84ab4-185d-7d5e-7703-3799e63efd91"><p id="_5f68f2e2-09b1-4378-0ead-77b79caf08de">17</p>
</dd>
<dt>Inputs (1 — 3)</dt>
<dd id="_97349d84-c229-a24f-a0cb-824fdafdb6b5"><p id="_2c42d488-c707-ed07-add6-45f3dfbe3ed3"><tt>input (non-differentiable) : T1</tt> — For real input, the following shape is expected: <tt>[signal_dim0][signal_dim1][signal_dim2]...[signal_dimN][1]</tt>. For complex input, the following shape is expected: <tt>[signal_dim0][signal_dim1][signal_dim2]...[signal_dimN][2]</tt>. The final dimension represents the real and imaginary parts of the value in that order.<br/> <tt>dft_length (optional, non-differentiable) : T2</tt> — The length of the signal as a scalar. If greater than the axis dimension, the signal will be zero-padded up to <tt>dft_length</tt>. If less than the axis dimension, only the first <tt>dft_length</tt> values will be used as the signal. If not provided, the default <tt>dft_length = signal_dim_axis</tt>, except for the IRFFT case (<tt>onesided=1</tt>, <tt>inverse=1</tt>), in which case the default dft_length is <tt>2 * (signal_dim_axis - 1)</tt>.<br/> <tt>axis (optional, non-differentiable) : tensor(int64)</tt> — The axis as a scalar on which to perform the DFT. Default is <tt>-2</tt> (last signal axis). Negative value means counting dimensions from the back. Accepted range is $[-r, -2] \cup [0, r-2]$ where <tt>r = rank(input)</tt>. The last dimension is for representing complex numbers and thus is an invalid axis.</p>
</dd>
<dt>Outputs</dt>
<dd id="_5172fb7f-b61c-3d4b-8f93-9fad0c2231ed"><p id="_ef2f5fc1-795e-bff2-1445-11996ba24e8f"><tt>output : T1</tt> — The Fourier Transform of the input vector. For standard DFT (<tt>onesided=0</tt>), the output shape is: <tt>[signal_dim0][signal_dim1][signal_dim2]...[signal_dimN][2]</tt> (complex), with <tt>signal_dim_axis = dft_length</tt>. For RFFT (<tt>onesided=1</tt>, <tt>inverse=0</tt>), the output shape is: <tt>[signal_dim0][signal_dim1][signal_dim2]...[signal_dimN][2]</tt> (one-sided complex), with <tt>signal_dim_axis = floor(dft_length/2) + 1</tt>. For IRFFT (<tt>onesided=1</tt>, <tt>inverse=1</tt>), the output shape is: <tt>[signal_dim0][signal_dim1][signal_dim2]...[signal_dimN][1]</tt> (real), where <tt>signal_dim_axis = dft_length</tt>.</p>
</dd>
<dt>Attributes</dt>
<dd id="_2efb63c9-6f54-2cfc-ddbe-de7b4d85a9a8"><p id="_7dc6013b-413f-6454-b0a3-07f240c9ade2"><tt>inverse : int (default is 0)</tt> — Whether to perform the inverse discrete Fourier Transform. Default is 0, which corresponds to <tt>false</tt>.<br/> <tt>onesided : int (default is 0)</tt> — If <tt>onesided</tt> is <tt>1</tt>, only values for <tt>k</tt> in <tt>[0, 1, 2, ..., floor(n_fft/2) + 1]</tt> are used or returned because the real-to-complex Fourier transform satisfies the conjugate symmetry, i.e., <tt>X[m, k] = X[m, n_fft-k]*</tt>, where <tt>m</tt> denotes “all other dimensions” DFT was not applied on. When <tt>onesided=1</tt> and <tt>inverse=0</tt> (forward DFT), only real input is supported and a one-sided complex spectrum is returned (RFFT). When <tt>onesided=1</tt> and <tt>inverse=1</tt> (inverse DFT), only complex input is supported and a full real signal is returned (IRFFT). Value can be <tt>0</tt> or <tt>1</tt>. Default is <tt>0</tt>.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_f81a62a8-af80-d284-a768-8bd6ebb23c94"><p id="_22b853e5-335a-10a1-6cde-5e38a83a9c36"><tt>T1 : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.<br/> <tt>T2 : tensor(int32), tensor(int64)</tt> — Constrain scalar length types to integers.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_46408f5e-c5bd-1643-51e3-23b5ff41a4a5"><p id="_785a8122-c01d-14f0-59bd-ecc1eeeb5727"><tt>test_dft</tt>, <tt>test_dft_axis</tt>, <tt>test_dft_inverse</tt>, <tt>test_dft_rfft</tt>, <tt>test_dft_irfft</tt>, <tt>test_dft_opset19</tt>, <tt>test_dft_axis_opset19</tt>, <tt>test_dft_inverse_opset19</tt>, <tt>test_dft_rfft_opset19</tt>, <tt>test_dft_irfft_opset19</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_8326875d-ebb6-1a67-df09-a88d4d16d9d3"><p id="_6a1f9584-ac6d-ab66-f067-99855a865990">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_46617074-0a39-44f7-df03-3fd7db0a852b" anchor="op-ai-onnx-default-deformconv" obligation="normative">
<title id="_14783dbd-ede1-fbff-c695-cba121b38e47">DeformConv</title>
<p id="_13c00d40-9e71-70ed-96cc-5bf5cacd1aa4">Performs deformable convolution as described in <link target="https://arxiv.org/abs/1703.06211"/> and <link target="https://arxiv.org/abs/1811.11168"/>. This operator specification supports the general N-D case. Note that most common use cases have 2D or 3D data.</p>

<dl id="_f215bd0f-6fde-5b3a-aaea-0c5f6fac1061"><dt>Domain</dt>
<dd id="_6923aeaf-68d7-3d3d-80ed-a7ddb78459e2"><p id="_f8e0e915-9884-97b6-05f3-c0462ad4a179"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_053d03db-2814-e5ce-b176-22b372e9d6b3"><p id="_bb6a00f7-9a5e-94ee-7e14-1939ee80d0fd">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_f0b177b2-74b0-b4c6-13c3-95aae420a1d1"><p id="_5e7a2d96-ed4c-df5c-873f-3bee1fd257e6">19</p>
</dd>
<dt>Inputs (3 — 5)</dt>
<dd id="_d8d6f441-6df2-ed89-8c5f-e251794792d5"><p id="_7a6228a3-472e-c1eb-6352-8833166e6595"><tt>X : T</tt> — Input data tensor. For 2D image data, it has shape (N, C, H, W) where N is the batch size, C is the number of input channels, and H and W are the height and width. In general, the shape is (N, C, D1, D2, …​ , Dn) for n-dimensional data, where D1 to Dn are the spatial dimension sizes. Most common use cases have n = 2 or 3.<br/> <tt>W : T</tt> — Weight tensor that will be used in the convolutions. It has shape (oC, C/group, kH, kW), where oC is the number of output channels and kH and kW are the kernel height and width. For more than 2 dimensions, it has shape (oC, C/group, k1, k2, …​ , kn).<br/> <tt>offset : T</tt> — Offset tensor denoting the offset for the sampling locations in the convolution kernel. It has shape (N, offset_group * kH * kW * 2, oH, oW) for 2D data or (N, offset_group * k1 * k2 * …​ * kn * n, o1, o2, …​ , on) for nD data. Use linear interpolationfor fractional offset values. Sampling locations outside of the padded input tensor gives zero.<br/> <tt>B (optional) : T</tt> — Optional 1D bias of length oC to be added to the convolution. Default is a tensor of zeros.<br/> <tt>mask (optional) : T</tt> — The mask tensor to be applied to each position in the convolution kernel. It has shape (N, offset_group * kH * kW, oH, oW) for 2D data or (N, offset_group * k1 * k2 * …​ * kn * n, o1, o2, …​ , on) for nD data. Default is a tensor of ones.</p>
</dd>
<dt>Outputs</dt>
<dd id="_c2c152c9-b801-1fc0-6f21-4289ec80bc38"><p id="_780a8c9b-7da1-561d-fae7-a8f36a9c0c29"><tt>Y : T</tt> — Output data tensor that contains the result of convolution. It has shape (N, oC, oH, oW) for 2D data or (N, oC, o1, o2, …​, on) for nD data</p>
</dd>
<dt>Attributes</dt>
<dd id="_c34b6fcb-284e-eeae-1de9-5f6ce989af96"><p id="_0abc5076-1db9-9412-72c0-e1d0273b38e8"><tt>dilations : list of ints</tt> — Dilation value along each spatial axis of the kernel. Default is 1 along each axis.<br/> <tt>group : int (default is 1)</tt> — Number of groups the input and output channels, C and oC, are divided into. C and oC must both be divisible by group. Default is 1.<br/> <tt>kernel_shape : list of ints</tt> — Shape of the convolution kernel. If not present, it is inferred from the shape of input W.<br/> <tt>offset_group : int (default is 1)</tt> — Number of groups of offset. C must be divisible by offset_group. Default is 1.<br/> <tt>pads : list of ints</tt> — Padding for the beginning and end along each spatial axis. The values represent the number of pixels added to the beginning and end of the corresponding axis and can take any nonnegative value. The format should be as follows: [x1_begin, x2_begin, …​, x1_end, x2_end, …​], where xi_begin is the number of pixels added at the beginning of axis <tt>i</tt> and xi_end is the number of pixels added at the end of axis <tt>i</tt>. Default is 0 along each axis.<br/> <tt>strides : list of ints</tt> — Stride along each spatial axis. Default is 1 along each axis.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_ca001039-77f5-905f-c806-312d147bf444"><p id="_fb72b50b-c6ac-120c-d3f9-c0f500027ec1"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_ff2ffcaf-5591-cbf1-ecf0-8acf64385f30"><p id="_fcf8262e-7b46-eeb2-45e1-22e0cea57309"><tt>test_basic_deform_conv_with_padding</tt>, <tt>test_basic_deform_conv_without_padding</tt>, <tt>test_deform_conv_with_mask_bias</tt>, <tt>test_deform_conv_with_multiple_offset_groups</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_f970fe95-5b26-00fc-9d8d-3be3316a91a0"><p id="_7f2ac220-e470-57c9-0ca6-fdd0201e3ac4">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_16d0b2cd-f97f-0ddb-69be-49955cb713d6" anchor="op-ai-onnx-default-depthtospace" obligation="normative">
<title id="_186d552e-183c-c162-f900-1f28eea33031">DepthToSpace</title>
<p id="_a9bdff3e-1959-0012-2010-d17b47b25215">DepthToSpace rearranges (permutes) data from depth into blocks of spatial data. This is the reverse transformation of SpaceToDepth. More specifically, this op outputs a copy of the input tensor where values from the depth dimension are moved in spatial blocks to the height and width dimensions. By default,  <tt>mode</tt> = <tt>DCR</tt>. In the DCR mode, elements along the depth dimension from the input tensor are rearranged in the following order: depth, column, and then row. The output y is computed from the input x as below:</p>

<sourcecode id="_daeb0a88-f48f-9d37-04e2-c88f8c101e97" unnumbered="true"><body>b, c, h, w = x.shape
tmp = np.reshape(x, [b, blocksize, blocksize, c // (blocksize**2), h, w])
tmp = np.transpose(tmp, [0, 3, 4, 1, 5, 2])
y = np.reshape(tmp, [b, c // (blocksize**2), h * blocksize, w * blocksize])</body></sourcecode>


<p id="_09e3e8a4-434c-b9b6-f97f-76ddb5dce972">In the CRD mode, elements along the depth dimension from the input tensor are rearranged in the following order: column, row, and the depth. The output y is computed from the input x as below:</p>

<sourcecode id="_51c8883b-1a5c-4bf3-588f-bd6eacb38f29" unnumbered="true"><body>b, c, h, w = x.shape
tmp = np.reshape(x, [b, c // (blocksize ** 2), blocksize, blocksize, h, w])
tmp = np.transpose(tmp, [0, 1, 4, 2, 5, 3])
y = np.reshape(tmp, [b, c // (blocksize ** 2), h * blocksize, w * blocksize])</body></sourcecode>


<dl id="_2c65746c-390c-47ce-0d74-37da24eb3332"><dt>Domain</dt>
<dd id="_caa84e28-4792-7f63-cb77-b08291f40666"><p id="_8f01fb17-8fa7-f236-f203-611886a6e39f"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_6ff82d2a-8972-644c-be02-029bd454cbec"><p id="_eebe2162-4c3e-3083-cac9-67e54aa3636d">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_e5a346a6-a410-e3e6-c144-95998cca8efc"><p id="_246342ea-1f0a-34e4-cd33-76393be4f71d">1, 11, 13</p>
</dd>
<dt>Inputs</dt>
<dd id="_e56dc859-73b0-3727-3233-0d3bb9e30322"><p id="_b0dcd6c3-9309-54f3-82bd-2752c0f462f2"><tt>input (differentiable) : T</tt> — Input tensor of [N,C,H,W], where N is the batch axis, C is the channel or depth, H is the height and W is the width.</p>
</dd>
<dt>Outputs</dt>
<dd id="_36787a44-3c9c-97d5-bb3b-37ef934254ed"><p id="_b55b267a-e4bd-495e-da2c-d59726366613"><tt>output (differentiable) : T</tt> — Output tensor of [N, C/(blocksize * blocksize), H * blocksize, W * blocksize].</p>
</dd>
<dt>Attributes</dt>
<dd id="_5f914ebc-c8d2-98a0-f68e-e16f005ad20b"><p id="_41dcaf8c-154d-8682-38d0-f7feebf3a2d3"><tt>blocksize : int (required)</tt> — Blocks of [blocksize, blocksize] are moved.<br/> <tt>mode : string (default is DCR)</tt> — DCR (default) for depth-column-row order re-arrangement. Use CRD for column-row-depth order.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_a611eba5-e456-5dca-95e2-0161ccd75c66"><p id="_ea479505-2564-2e37-3a01-d2219dd5953b"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input and output types to all tensor types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_585af883-5a7d-7d1e-b996-6ca2319625b9"><p id="_882e6458-e6d0-46f1-5125-185373652462"><tt>test_depthtospace_crd_mode_example</tt>, <tt>test_depthtospace_example</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_a7396f5d-d8e5-e22e-6e37-02be1bca0465"><p id="_0644cfed-3177-b485-11ad-3349edb4df41">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_f8c5e12e-c234-32e5-4bda-9aa363d6ec0f" anchor="op-ai-onnx-default-dequantizelinear" obligation="normative">
<title id="_2f889272-2a45-87d0-ae17-a0e040240fd7">DequantizeLinear</title>
<p id="_afe0b0bb-1929-71e9-c02c-2a91c011009f">The linear dequantization operator. It consumes a quantized tensor, a scale, and a zero point to compute the full-precision tensor. The dequantization formula is  <tt>y = (x - x_zero_point) * x_scale</tt>. <tt>x_scale</tt> and <tt>x_zero_point</tt> must have the same shape, determining the quantization’s granularity: a scalar for per-tensor/per-layer quantization, a 1-D tensor for per-axis quantization, or have a rank identical to the input for blocked quantization. See QuantizeLinear for details on quantization granularity.</p>

<p id="_a778593f-4a05-bfaf-e1d4-f2c2973592ba"><tt>x_zero_point</tt> and <tt>x</tt> must have the same type. <tt>x</tt> and <tt>y</tt> must have the same shape. In the case of dequantizing <tt>int32</tt>, there’s no zero point (zero point is supposed to be 0). <tt>zero-point</tt> is usually not used in the case of float8 and 4-bit types quantization, but the dequantization formula remains the same for consistency. The output type is determined by the attribute  <tt>output_dtype</tt>. If <tt>output_dtype</tt> is not supplied then the output type is the same as  <tt>x_scale</tt>. The output type also determines the precision of the multiplication operation.</p>

<dl id="_d586e2f2-23da-80b6-b5b9-88d7ff7c1dc6"><dt>Domain</dt>
<dd id="_ce9c08ff-da76-99d0-1310-9b8331dcc04e"><p id="_8fe47c6d-16bd-da33-f506-ed19a8d196ae"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_3f0e9a06-c2e1-b9d9-ad45-dbbe05fe6a4b"><p id="_8b9cbae5-47ae-1b92-7998-426303ec15d7">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_3f372dd2-f607-e4e8-ab53-d0a9669dce66"><p id="_c3e322ea-ceae-890b-54fa-68c1fa491912">10, 13, 19, 21, 23, 24, 25</p>
</dd>
<dt>Inputs (2 — 3)</dt>
<dd id="_0d2d2b08-46f5-3f2d-874b-645871c9e9f3"><p id="_e80865da-681f-a1d8-efa0-4df3be42a648"><tt>x : T1</tt> — N-D quantized input tensor to be de-quantized.<br/> <tt>x_scale : T2</tt> — Scale for input <tt>x</tt>. For per-tensor/layer dequantization the scale is a scalar, for per per-axis dequantization it is a 1-D Tensor and for blocked dequantization it has the same shape as the input, except for one dimension in which blocking is performed.<br/> <tt>x_zero_point (optional) : T1</tt> — Zero point for input <tt>x</tt>. Shape must match x_scale. It’s optional. Zero point is 0 when it’s not specified.</p>
</dd>
<dt>Outputs</dt>
<dd id="_183dd4fc-f1da-2c91-aa65-963da7387b1b"><p id="_cfe8ffd2-5f92-a80f-9041-40fa441f628b"><tt>y : T3</tt> — N-D full precision output tensor. It has the same shape as input <tt>x</tt>. The data type is specified by the <tt>output_dtype</tt> attribute or, in its absence, the type of <tt>x_scale</tt>.</p>
</dd>
<dt>Attributes</dt>
<dd id="_ba17dbce-de62-ce0d-5dae-054d3ce20a51"><p id="_34a0bbf8-0a80-efb8-6bd1-211b5ab7fafe"><tt>axis : int (default is 1)</tt> — (Optional) The axis of the dequantizing dimension of the input tensor. Used for per-axis and blocked quantization. Negative value means counting dimensions from the back. Accepted range is <tt>[-r, r-1]</tt> where <tt>r = rank(input)</tt>.<br/> <tt>block_size : int (default is 0)</tt> — (Optional) The size of the quantization block (number of times every scale is replicated). Used only for blocked quantization. The block size is a positive integer. Given <tt>x</tt> shape <tt>(D0, ..., Di, ..., Dn)</tt>, <tt>y_scale</tt> shape <tt>(S0, ... Si, ...Sn)</tt> and <tt>axis=i</tt>, the accepted range is <tt>[ceil(Di/Si), ceil(Di/(Si-1))-1]</tt><br/> <tt>output_dtype : int (default is 0)</tt> — (Optional) The output data type. If not supplied, the output data type is inferred from <tt>x_scale</tt> data type (<tt>T2</tt>)</p>
</dd>
<dt>Type constraints</dt>
<dd id="_2afc86de-c03d-bf8a-978a-a6ac20f08d73"><p id="_45befccd-6dea-8e19-8289-7e6e3907eb31"><tt>T1 : tensor(int8), tensor(uint8), tensor(int16), tensor(uint16), tensor(int32), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(uint2), tensor(int2), tensor(float6e2m3), tensor(float6e3m2)</tt> — The type of the inputs ‘x_zero_point’ and ‘x’.<br/> <tt>T2 : tensor(float), tensor(float16), tensor(bfloat16), tensor(float8e8m0)</tt> — The type of the input ‘x_scale’.<br/> <tt>T3 : tensor(float), tensor(float16), tensor(bfloat16)</tt> — The type of the output ‘y’.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_e412f208-94b7-854a-4634-b7f473cb2328"><p id="_c2bf8bb4-83af-1fc8-f77c-2cb6882ffc8e"><tt>test_dequantizelinear_axis</tt>, <tt>test_dequantizelinear_blocked</tt>, <tt>test_dequantizelinear</tt>, <tt>test_dequantizelinear_e4m3fn</tt>, <tt>test_dequantizelinear_e4m3fn_float16</tt>, <tt>test_dequantizelinear_e4m3fn_zero_point</tt>, <tt>test_dequantizelinear_e5m2</tt>, <tt>test_dequantizelinear_float4e2m1</tt>, <tt>test_dequantizelinear_int16</tt>, <tt>test_dequantizelinear_int2</tt>, <tt>test_dequantizelinear_int4</tt>, <tt>test_dequantizelinear_uint16</tt>, <tt>test_dequantizelinear_uint2</tt>, <tt>test_dequantizelinear_uint4</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_208af84a-3454-9457-e049-db665cf2c8bf"><p id="_2da4cbc8-557d-777d-25c1-4351d2bd8d2f">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_6f16912d-0955-252b-0bc3-296b97765eb9" anchor="op-ai-onnx-default-det" obligation="normative">
<title id="_37e92c8c-7661-71ba-7393-e6aebf69fc8d">Det</title>
<p id="_78c1b324-83f3-b6c8-9d12-8b58d0b6d491">Det calculates determinant of a square matrix or batches of square matrices. Det takes one input tensor of shape  <tt>[*, M, M]</tt>, where <tt>*</tt> is zero or more batch dimensions, and the inner-most 2 dimensions form square matrices. The output is a tensor of shape  <tt>[*]</tt>, containing the determinants of all input submatrices. e.g., When the input is 2-D, the output is a scalar(shape is empty:  <tt>[]</tt>).</p>

<dl id="_b7bdc49e-d9d1-5811-8711-1d3a4a5d816c"><dt>Domain</dt>
<dd id="_149417cd-2e0a-dcce-0a07-729813bc4d77"><p id="_5fabf527-a06e-bc2b-f890-1a1bb1421080"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_54d4d9ab-9232-747a-3869-9fa221870374"><p id="_e5ca3e8d-6718-f663-2ace-035f65449307">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_260b91eb-b2e0-fac1-3b35-bcb305de7fc9"><p id="_897c9f98-66d0-fa88-8081-a03fdddf1db3">11</p>
</dd>
<dt>Inputs</dt>
<dd id="_84fd3709-e84c-f8bf-4759-f89014ef7891"><p id="_fe701d23-a95e-fdd9-61d1-67e739c2faae"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_1275f7c6-600d-3c0a-5e94-07abf9424617"><p id="_7b9c6875-e1d4-c315-fc7a-988282ae4031"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_802f8140-1816-1820-0ce6-2f951e6d38a8"><p id="_721a9dc2-f100-ba49-c33a-811ead47304f">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_f7780435-e17d-9742-8ef6-2340c29fa750"><p id="_19ac841b-69f9-379b-af28-05dc0038e9a4"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to floating-point tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_c364d287-c29b-8018-aee5-48357b2f125c"><p id="_cb45b92d-c5bc-f423-26fc-de42bb48f9b6"><tt>test_det_2d</tt>, <tt>test_det_nd</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_f5f8e2da-fd81-b5a5-a6e3-4977ed06aecd"><p id="_5ff76343-7137-8a27-63f0-ca1f6dc6b4de">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_490bd372-539f-f022-2faf-d2c84fbf5479" anchor="op-ai-onnx-default-div" obligation="normative">
<title id="_c5e00207-e224-1f05-242d-b2814ee33be4">Div</title>
<p id="_015d1976-e14f-e7fb-c675-2c1a4c93cf78">Performs element-wise binary division (with Numpy-style broadcasting support).</p>

<p id="_00e8dc69-78fe-0e59-c06d-97af4a51b594">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<p id="_83eb4b5b-eb49-728f-1da7-a48109a35717">For integer inputs, the result is computed using truncating division (rounding toward zero). (Opset 14 change): Extend supported types to include uint8, int8, uint16, and int16.</p>

<dl id="_a5e80870-484c-2cec-12bf-cd9ff5f9f867"><dt>Domain</dt>
<dd id="_a954cce7-519c-ac90-5c6a-a1376711234c"><p id="_b9134fcc-3e88-c754-8b5b-b4c827a957f4"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_bdea628f-08ae-a9a9-2162-c40854ad3b92"><p id="_5f7b6d48-720e-829c-63f4-1acee84db453">14</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_05b31c93-1156-859f-c69a-e87a82f1e3e9"><p id="_7014ff92-76c2-8514-f2c9-7ebdeb650894">1, 6, 7, 13</p>
</dd>
<dt>Inputs</dt>
<dd id="_57d48032-d7ec-418b-d70b-3aab14408cf9"><p id="_33470ebd-f118-f9b3-8b44-28c4a5c02f30"><tt>A (differentiable) : T</tt> — First operand.<br/> <tt>B (differentiable) : T</tt> — Second operand.</p>
</dd>
<dt>Outputs</dt>
<dd id="_60e054fb-4b68-fb8d-b258-3474e08e294e"><p id="_ba85ccab-b97b-98af-2a04-8f22595bc194"><tt>C (differentiable) : T</tt> — Result, has same element type as two inputs</p>
</dd>
<dt>Attributes</dt>
<dd id="_95ec5961-94b6-52f7-631a-058695906e99"><p id="_8eba9b62-bbe7-75e9-34e8-f9e636e0cd0b">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_77641d10-a212-da3e-826f-110f9dd823a0"><p id="_77f4aed2-5cf3-44ba-e7e9-f53fc41111a5"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to all numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_c5966489-10e7-4fa7-dcd8-e55ded8f67da"><p id="_a8844ab0-4150-4f39-3ab0-f1f7c2e6a909"><tt>test_div_example</tt>, <tt>test_div</tt>, <tt>test_div_int8</tt>, <tt>test_div_int16</tt>, <tt>test_div_int32_trunc</tt>, <tt>test_div_uint8</tt>, <tt>test_div_uint16</tt>, <tt>test_div_uint32</tt>, <tt>test_div_uint64</tt>, <tt>test_div_bcast</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_fe4b2908-fe36-c239-850c-b4b8697ef053"><p id="_bbfe9b3e-aa7b-9860-f433-4ad761b4b425">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_565ca6d2-1bf1-2a45-6f85-fed2650d8028" anchor="op-ai-onnx-default-dropout" obligation="normative">
<title id="_2daed84e-9e00-68f0-f7ff-d49388f43792">Dropout</title>
<p id="_fd6f8b1b-5506-d3f7-872a-cda1c9b547bc">Dropout takes an input floating-point tensor, an optional input ratio (floating-point scalar) and an optional input training_mode (boolean scalar). It produces two tensor outputs, output (floating-point tensor) and mask (optional  <tt>Tensor&lt;bool&gt;</tt>). If <tt>training_mode</tt> is true then the output Y will be a random dropout; Note that this Dropout scales the masked input data by the following equation, so to convert the trained model into inference mode, the user can simply not pass  <tt>training_mode</tt> input or set it to false.</p>

<sourcecode id="_fc3b3c9e-89c2-8d60-2086-af2cefe63b26" unnumbered="true"><body>output = scale * data * mask,</body></sourcecode>


<p id="_b4658a6b-edee-166f-9fe1-d5f7291d4d99">where</p>

<sourcecode id="_96e7aab5-7134-1005-e413-1e402649e189" unnumbered="true"><body>scale = 1. / (1. - ratio).</body></sourcecode>


<p id="_388ea320-49d0-d87f-c367-baf1945bfc03">This operator has <strong>optional</strong> inputs/outputs. See the doc for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument’s name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.</p>

<dl id="_537ad164-9534-d777-63eb-e085c2d4d934"><dt>Domain</dt>
<dd id="_7ac5b58e-fbcc-2ea0-8988-fcaa8681a5bb"><p id="_15b9e57b-3562-5593-4268-841a8ca8fa25"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_668a3a0c-a9e7-123c-248f-ded3b59979f2"><p id="_f983cc23-422e-b91c-5ab1-0e0eba695502">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_5157efa7-2a0f-03f9-9ab8-2caeb1f76517"><p id="_bedd4dbb-5c88-fb8a-b557-912c2a9c1cfc">1, 6, 7, 10, 12, 13</p>
</dd>
<dt>Inputs (1 — 3)</dt>
<dd id="_a49dce97-a8d5-868c-82d8-f62b46c8c01c"><p id="_ea970d33-1e43-2525-0280-4ffc094713c0"><tt>data (differentiable) : T</tt> — The input data as Tensor.<br/> <tt>ratio (optional, non-differentiable) : T1</tt> — The ratio of random dropout, with value in [0, 1). If set to 0, the output would be a simple copy of the input. If it’s non-zero, output will be a random dropout of the scaled input, which is typically the case during training. It is an optional value, if not specified it will default to 0.5.<br/> <tt>training_mode (optional, non-differentiable) : T2</tt> — If set to true then it indicates dropout is being used for training. It is an optional value hence unless specified explicitly, it is false. If it is false, ratio is ignored and the operation mimics inference mode where nothing will be dropped from the input data and if mask is requested as output it will contain all ones.</p>
</dd>
<dt>Outputs (1 — 2)</dt>
<dd id="_950ac23f-6675-50dc-0d87-6c2e27fc5df8"><p id="_5dbe4bb2-4fe0-bb62-f938-0e5e15dc4ce4"><tt>output (differentiable) : T</tt> — The output.<br/> <tt>mask (optional, non-differentiable) : T2</tt> — The output mask.</p>
</dd>
<dt>Attributes</dt>
<dd id="_5981b46c-3afe-70ad-846a-72f040dcc9a3"><p id="_4801b19a-5017-cfaa-5172-a28d727f8a4e"><tt>seed : int</tt> — (Optional) Seed to the random generator, if not specified we will auto generate one.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_bb8635d4-a104-11b8-2637-2f41bb12b6ec"><p id="_7e5db72d-344e-eedd-969a-295ed7438622"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz)</tt> — Constrain input and output types to float tensors.<br/> <tt>T1 : tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz)</tt> — Constrain input ‘ratio’ types to float tensors.<br/> <tt>T2 : tensor(bool)</tt> — Constrain output ‘mask’ types to boolean tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_9639fd09-f0ae-e125-91c5-d31dacbdd511"><p id="_c90a72c3-2aa3-3b37-9ebe-b8a480793e8b"><tt>test_dropout_default</tt>, <tt>test_dropout_default_mask</tt>, <tt>test_dropout_default_mask_ratio</tt>, <tt>test_dropout_default_old</tt>, <tt>test_dropout_default_ratio</tt>, <tt>test_dropout_random_old</tt>, <tt>test_training_dropout</tt>, <tt>test_training_dropout_default</tt>, <tt>test_training_dropout_default_mask</tt>, <tt>test_training_dropout_zero_ratio</tt>, <tt>test_training_dropout_zero_ratio_mask</tt>, <tt>test_training_dropout_mask</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_3c68ea79-8529-08a4-aba1-12513c5bc9fc"><p id="_b6d4e331-f39f-cb9b-6097-fa95c70a3a10">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_183fb6f8-65eb-c1de-d6dc-9db1362890f9" anchor="op-ai-onnx-default-dynamicquantizelinear" obligation="normative">
<title id="_5ca8ed95-0aae-3d3d-2d82-fde44f916203">DynamicQuantizeLinear</title>
<p id="_eb18822f-5a69-e3cb-2b64-3d01069f2568">A Function to fuse calculation for Scale, Zero Point and FP32-&gt;8Bit conversion of FP32 Input data. Outputs Scale, ZeroPoint and Quantized Input for a given FP32 Input. Scale is calculated as:</p>

<sourcecode id="_32bc53fc-0439-791f-ce27-739e3bd07333" unnumbered="true"><body>y_scale = (maximum(0, max(x)) - minimum(0, min(x))) / (qmax - qmin)</body></sourcecode>


<ul id="_99d894d1-fc19-1c3b-d187-e5192146c21f"><li><p id="_cb7dc2e6-3c76-8788-9b92-a3be44c653d6">where qmax and qmin are max and min values for quantization range i.e. [0, 255] in case of uint8</p>
</li>
<li><p id="_e8139455-966a-5873-a3b6-a67d0a020dd4">data range is adjusted to include 0.</p>
</li>
</ul>

<p id="_211843c5-6163-0742-01c5-09dc5b54a3d9">Zero point is calculated as:</p>

<sourcecode id="_0fa3e0d0-3b07-c548-4403-664922fddeb8" unnumbered="true"><body>intermediate_zero_point = qmin - min(x)/y_scale
y_zero_point = cast(round(saturate(intermediate_zero_point)))</body></sourcecode>


<ul id="_26b7a45b-30d4-9a75-dae2-6ebe19c5cdfe"><li><p id="_f3e43eb7-0ad9-d9ed-e83f-63a2d6be281d">where qmax and qmin are max and min values for quantization range .i.e [0, 255] in case of uint8</p>
</li>
<li><p id="_973c0623-1ed3-c82d-cf7b-b7d1287af5a9">for saturation, it saturates to [0, 255] if it’s uint8, or [-127, 127] if it’s int8. Right now only uint8 is supported.</p>
</li>
<li><p id="_98a8ed94-f9a4-f0fa-ff45-138e3d29fceb">rounding to nearest ties to even.</p>
</li>
</ul>

<p id="_e1c23586-3280-4f87-e4ca-717361e9beb6">Data quantization formula is:</p>

<sourcecode id="_e318a2ec-3944-d4d6-1387-467274bed1fd" unnumbered="true"><body>y = saturate (round (x / y_scale) + y_zero_point)</body></sourcecode>


<ul id="_c2492a5f-298d-c49c-09cb-ba805ac57c33"><li><p id="_582133ad-7343-5758-0742-6dc7bdf99117">for saturation, it saturates to [0, 255] if it’s uint8, or [-127, 127] if it’s int8. Right now only uint8 is supported.</p>
</li>
<li><p id="_38c28e95-c860-4f35-89e7-bc4640c28727">rounding to nearest ties to even.</p>
<dl id="_5ec1d172-8b2f-dc63-e36b-ccaedc4fa96f"><dt>Domain</dt>
<dd id="_5f8363f8-5782-56cf-9e2d-6e4a8cec5266"><p id="_556f83bd-1522-5e17-9fa4-8d5b007dcc38"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_e230dab2-a169-927f-7e25-cd56728f9883"><p id="_a051aa0c-e5d7-962e-9ba7-2cf99e6cc5e0">11</p>
</dd>
<dt>Inputs</dt>
<dd id="_4b264d7a-a7e3-845f-e847-965d1fb7d58d"><p id="_eb989be7-5dd2-4e8a-3dfc-d4a92ab7464d"><tt>x : T1</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_af8c7d25-1f4d-af40-c6e3-54f8dbdaca66"><p id="_c7b43ca6-8c7f-9013-4ab4-086342bc385c"><tt>y : T2</tt> — Quantized output tensor<br/> <tt>y_scale : tensor(float)</tt> — Output scale. It’s a scalar, which means a per-tensor/layer quantization.<br/> <tt>y_zero_point : T2</tt> — Output zero point. It’s a scalar, which means a per-tensor/layer quantization.</p>
</dd>
<dt>Attributes</dt>
<dd id="_cbad0305-4e8c-6eeb-6bb3-7c5aab9f07f6"><p id="_a8ceff87-0378-a3ed-d6b3-a1ecfb1f52e9">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_9f6827cf-6045-d804-ac4d-2f3777685d7c"><p id="_e3722f9c-45ab-78ce-7b7b-c3a9fe235770"><tt>T1 : tensor(float)</tt> — Constrain ‘x’ to float tensor.<br/> <tt>T2 : tensor(uint8)</tt> — Constrain ‘y_zero_point’ and ‘y’ to 8-bit unsigned integer tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_caf830cc-0f9b-a43f-5b9e-070d0d23802d"><p id="_41ca461a-6501-9306-ca8c-a6520c24ca9a"><tt>test_dynamicquantizelinear</tt>, <tt>test_dynamicquantizelinear_max_adjusted</tt>, <tt>test_dynamicquantizelinear_min_adjusted</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_48dad3ef-f171-f094-3a00-6d854a5dc7b3"><p id="_6ea24e1b-0bf1-35c8-e6bf-0104940d0690">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</li>
</ul>
</clause>

<clause id="_cbfecf24-40a6-267a-ea5e-23b823606b96" anchor="op-ai-onnx-default-einsum" obligation="normative">
<title id="_a99418e8-6ea0-108a-d20a-2415329a1d67">Einsum</title>
<p id="_ebbb4b8d-c55a-2432-06bd-41c1c3f6b1fd">An einsum of the form <tt>term1, term2 -&gt; output-term</tt> produces an output tensor using the following equation</p>

<sourcecode id="_4515ca12-41ec-907e-76a2-a6e66f460da2" unnumbered="true"><body>output[output-term] = reduce-sum( input1[term1] * input2[term2] )</body></sourcecode>


<p id="_5067b5e1-13d7-ab86-da78-b461494ccdd6">where the reduce-sum performs a summation over all the indices occurring in the input terms (term1, term2) that do not occur in the output-term.</p>

<p id="_f262beaa-1990-1117-c713-140c78397d0b">The Einsum operator evaluates algebraic tensor operations on a sequence of tensors, using the Einstein summation convention. The equation string contains a comma-separated sequence of lower case letters and/or upper case letters. Each term corresponds to an operand tensor, and the characters within the terms correspond to operands dimensions. Lower case letters and upper case letters are treated as distinct symbols, that is, “a” and “A” refer to different symbols.</p>

<p id="_1828be54-1d84-4131-6fce-52ebde62c86e">This sequence may be followed by “-&gt;” to separate the left and right hand side of the equation. If the equation contains “-&gt;” followed by the right-hand side, the explicit (not classical) form of the Einstein summation is performed, and the right-hand side indices indicate output tensor dimensions. In other cases, output indices are (implicitly) set to the sequence of indices appearing exactly once in the equation, sorted in increasing order of their ASCII values (so that all upper case letters precede all lower case letters, e.g., “A” &lt; “Z” &lt; “a” &lt; “z”).</p>

<p id="_4b31aef4-44b8-eda7-c412-c68008196132">When a dimension character is repeated in the left-hand side, it represents summation along the dimension.</p>

<p id="_37052df8-6d99-d015-f62e-9eef036554bf">The equation may contain ellipsis (“…​”) to enable broadcasting. Ellipsis must indicate a fixed number of dimensions. Specifically, every occurrence of ellipsis in the equation must represent the same number of dimensions. The right-hand side may contain exactly one ellipsis. In implicit mode, the ellipsis dimensions are set to the beginning of the output. The equation string may contain space (U+0020) character.</p>

<dl id="_11b77d33-ff8f-1cfa-f56a-b4e98419728b"><dt>Domain</dt>
<dd id="_aeed8258-bd88-d804-fd02-eca7454468f1"><p id="_0268b58a-b736-0108-ebd7-7de8b8d1bb6f"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_09d10f8f-7b37-623d-dbfb-ef989a5ac6e7"><p id="_47396f81-6f4d-2558-ce27-bb14e60a47b2">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_dc1babf0-8683-fc7a-3762-d45584d76ac4"><p id="_112a3d23-4bd3-2142-5d6d-678e5d72bf88">12</p>
</dd>
<dt>Inputs (1 — unbounded)</dt>
<dd id="_e2863dd8-88e5-3efb-d92c-078dd8bec2fd"><p id="_60db6a32-45c0-47c0-30bb-acecd0ce9d32"><tt>Inputs (variadic, differentiable) : T</tt> — Operands</p>
</dd>
<dt>Outputs</dt>
<dd id="_2400d1a0-2e8e-e9d0-40a9-1a67eaa75091"><p id="_5c09552d-8a5f-4086-fc89-018532bc6846"><tt>Output (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_48e362a0-bd56-dae4-99f8-96637d683ad8"><p id="_faa7b1a4-faa7-e539-ff3e-94b463032d6f"><tt>equation : string (required)</tt> — Einsum expression string.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_0a72d73e-8d99-03c4-b1eb-4f42e08afbb8"><p id="_38f0ed4b-f72d-a331-bc5b-3e3ebd1b113f"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to all numerical tensor types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_77ca66c1-476e-5ecb-c650-1937f7139ede"><p id="_12b8c66d-ccf0-18a0-462e-dda541318523"><tt>test_einsum_batch_diagonal</tt>, <tt>test_einsum_batch_matmul</tt>, <tt>test_einsum_batch_matmul_bfloat16</tt>, <tt>test_einsum_inner_prod</tt>, <tt>test_einsum_scalar</tt>, <tt>test_einsum_sum</tt>, <tt>test_einsum_sum_bfloat16</tt>, <tt>test_einsum_transpose</tt>, <tt>test_einsum_transpose_bfloat16</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_b89a1aab-309e-06f1-a59f-0f86e5ef4001"><p id="_c8e37c05-f72e-bb58-8aaf-882d90905625">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_d7457542-5657-a2aa-e9a3-c09a7e502e1d" anchor="op-ai-onnx-default-elu" obligation="normative">
<title id="_e4e10f5b-525d-5b48-390b-fce87ac5d82b">Elu</title>
<p id="_d829c456-67d1-96d7-a2be-661089d7ad1f">Elu takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the function <tt>f(x) = alpha * (exp(x) - 1.) for x &lt; 0`, `f(x) = x for x &gt;= 0</tt>., is applied to the tensor elementwise.</p>

<dl id="_061574db-d5b8-00c6-9a4d-6eea2a632e2b"><dt>Domain</dt>
<dd id="_69f54492-0778-17e6-f6ef-a54eae9c6537"><p id="_9ba75d7c-1daf-6110-bbae-6ed3598c06ae"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_6fdb0a1b-78bd-873d-6103-0ba87bb27c21"><p id="_8c711255-a618-4bf6-8eb8-182cf5a2ab42">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_7e02ffee-257b-7c4d-1ebb-8abf743219aa"><p id="_bad80f2d-3c29-4d18-3783-4ae7fb381b54">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_90c48f6b-13f3-0d96-b982-36b8759ab78c"><p id="_7742d57a-eac7-3298-a21d-5da6a7b142ce"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_775c355c-a907-3438-926a-f945bff557cc"><p id="_4a8f19e5-f88b-e62e-7b62-2f8477fe2065"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_1c5da0c8-8d0a-554f-123e-db1909f15c74"><p id="_c8caa4b7-9d9d-0a92-b46f-b95ca9cb3865"><tt>alpha : float (default is 1.0)</tt> — Coefficient of ELU.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_5d16e405-66a9-1862-0ee8-98c79c05c661"><p id="_69accb8e-ee9a-17e1-5254-c8254db3478a"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_fad51885-5134-f63b-780a-7fe0bc9ac709"><p id="_a5ffb35f-2979-0376-7cb8-4bd7183da9c9"><tt>test_elu_example</tt>, <tt>test_elu</tt>, <tt>test_elu_default</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_075a0c75-9ad7-83b8-bb23-24c8c4e0a3cd"><p id="_bfea9efd-b8c7-c1e5-631a-2cd9378f3cba">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_a059976b-8b1d-ad1b-510e-4ce00cfe4491" anchor="op-ai-onnx-default-equal" obligation="normative">
<title id="_d03d2d67-b95c-9a82-642c-a481eeccfe99">Equal</title>
<p id="_24d8cb45-1979-bdb5-ba24-f0e19b30d1b5">Returns the tensor resulted from performing the <tt>equal</tt> logical operation elementwise on the input tensors  <tt>A</tt> and <tt>B</tt> (with Numpy-style broadcasting support).</p>

<p id="_abfc96d3-0227-1ecd-3d5c-edd91280de3d">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_3bc635e4-fbdd-2544-b549-312267862c27"><dt>Domain</dt>
<dd id="_7be437a6-71a2-e2c2-0965-2b1b8b731e08"><p id="_b19c13bd-4071-5263-222d-a80ac97cfc80"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_cb3e0d07-f6cc-0895-ad0a-aee74eb68d7c"><p id="_138a5737-949b-c094-c3f8-1d06bff3d737">19</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_7c282154-44d6-b0d6-c856-d5a6ca1c8ae5"><p id="_271089ce-13e2-ae21-43dc-a7ad872db7d5">1, 7, 11, 13</p>
</dd>
<dt>Inputs</dt>
<dd id="_5db58602-6420-9ff3-2175-d4356128152d"><p id="_73ebb863-5a4e-6c2a-f3d9-4f1a0349237c"><tt>A (non-differentiable) : T</tt> — First input operand for the logical operator.<br/> <tt>B (non-differentiable) : T</tt> — Second input operand for the logical operator.</p>
</dd>
<dt>Outputs</dt>
<dd id="_5980e924-2d2f-5c69-478d-a0e28b3138b3"><p id="_1539a1b9-6323-db8a-3647-42696c225afe"><tt>C (non-differentiable) : T1</tt> — Result tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_4999744d-f06c-a6e6-f321-b38cc7f20ad4"><p id="_90540fa0-471e-7221-9229-8d422a876204">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_331054ae-befc-5a28-1a64-aa3bf4b0ddc4"><p id="_53dc10fb-d071-e0d7-2d53-02ea7a55d77f"><tt>T : tensor(bool), tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16), tensor(string)</tt> — Constrain input types to all (non-complex) tensors.<br/> <tt>T1 : tensor(bool)</tt> — Constrain output to boolean tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_7854cb75-dfeb-9fe3-619d-48cfbad43efe"><p id="_3be6c5b9-3e0c-6991-b3d8-075e9e5ee73e"><tt>test_equal</tt>, <tt>test_equal_int8</tt>, <tt>test_equal_int16</tt>, <tt>test_equal_uint8</tt>, <tt>test_equal_uint16</tt>, <tt>test_equal_uint32</tt>, <tt>test_equal_uint64</tt>, <tt>test_equal_bcast</tt>, <tt>test_equal_string</tt>, <tt>test_equal_string_broadcast</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_28fbc939-0c44-400b-0895-4ee78b467028"><p id="_adde5b14-da1a-1e81-c25b-490e46c88c77">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_52823301-7556-2342-d97b-5132b1d5185a" anchor="op-ai-onnx-default-erf" obligation="normative">
<title id="_1d29918e-52e3-b681-4003-e14fa0d0af41">Erf</title>
<p id="_b82c46a2-d42f-4c2a-8ef1-7c937d4ffe9c">Computes the error function of the given input tensor element-wise.</p>

<dl id="_72315c51-919d-fbd6-ce51-f86f849c77c8"><dt>Domain</dt>
<dd id="_27e0c762-2fbd-005a-bca0-9aa21e62a80d"><p id="_5d5f4b88-cf62-fa75-c281-ae8a76bbd1e6"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_aabf1f3d-9b3a-1b50-3425-f6062d409ca0"><p id="_d177e9c8-1aca-0dde-ef56-ec4683060056">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_fc0454a1-38d9-3489-19be-cb209f206d09"><p id="_1cfeed2f-28d0-9b05-f793-dc9d00cadb43">9</p>
</dd>
<dt>Inputs</dt>
<dd id="_016ecb35-0a91-6185-3819-bcde799c9fd6"><p id="_623c36ed-4b78-616f-adbc-bbd45e3843a5"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_7147b324-1879-fdd4-47c4-2436c3312894"><p id="_0475f937-d103-b6b7-edc4-7898527c3b1d"><tt>output (differentiable) : T</tt> — The error function of the input tensor computed element-wise. It has the same shape and type of the input.</p>
</dd>
<dt>Attributes</dt>
<dd id="_4027cb4e-1a6c-3407-b05d-799ecdf6a0dd"><p id="_ec745640-f24a-aa47-c2ad-5e22e47879a8">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_82f4ffe5-a594-d05c-7f61-ae899e75b965"><p id="_c1ea1454-83f1-ead7-7e14-89d82931c2f8"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_4aaebc95-6bf1-b365-88ac-9bacf08d1f2a"><p id="_40635906-089a-09d7-bcf1-752774e91538"><tt>test_erf</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_3caf9726-dc3e-4a69-6058-37147b9bb4dc"><p id="_87a05f64-ff95-2801-64c4-9a9222967acd">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_8729de33-476e-7fce-8daf-eceaa0cf340b" anchor="op-ai-onnx-default-exp" obligation="normative">
<title id="_b5f49129-084c-ede6-03eb-92293e8d43b9">Exp</title>
<p id="_fd0b4961-8028-bbf0-b744-3714272c8b52">Calculates the exponential of the given input tensor, element-wise.</p>

<dl id="_6cd6ebde-ade4-dde6-d016-9db44d90e0e8"><dt>Domain</dt>
<dd id="_976b6c11-7d67-12fa-93bd-ec0deeafb68f"><p id="_9f241e58-1f03-63ad-f9b9-dee91d408b6b"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_b4e41dde-4b45-45e6-0f74-a95354fd0d35"><p id="_61904158-b277-00d7-be0b-c1c9c5666767">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_5480fedd-4d30-a9e8-9a1e-684fabccd5ff"><p id="_895790b1-396a-c824-5a31-2ae29dc14460">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_00a065c0-c04e-3949-1b89-e04d96b5955f"><p id="_f6c11d59-568d-8628-0f5c-6e6b8d4638f7"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_8df8fe0a-3638-59c6-d47b-8d6916c54862"><p id="_b1876f79-869f-386e-d89c-f48cd778684d"><tt>output (differentiable) : T</tt> — The exponential of the input tensor computed element-wise</p>
</dd>
<dt>Attributes</dt>
<dd id="_4a87de5a-25e2-b4ae-ead5-8c14a5bd05e8"><p id="_27d44a3c-5a74-db07-b022-4f60a740bc6e">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_c443000e-172e-f426-a55b-311ae4b4c0ea"><p id="_192fe579-cbbe-9c70-ea8e-200b530b6bb3"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_305167eb-ec21-2405-8828-9801f9778cc6"><p id="_d3847b72-ce60-2e70-4d91-bd2bfb726d66"><tt>test_exp_example</tt>, <tt>test_exp</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_2240084a-8aa8-235e-970b-6660ba803cc0"><p id="_02d499d3-be46-5bb1-7425-b1d984729776">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_e2e1c30c-3fd8-90a1-1b90-2afbdf2b6767" anchor="op-ai-onnx-default-expand" obligation="normative">
<title id="_9923feee-1142-a44f-7e38-c808c2a710c2">Expand</title>
<p id="_a6f5c914-5608-bc2a-ff00-b4309779eb8d">Broadcast the input tensor following the given shape and the broadcast rule. The broadcast rule is similar to numpy.array(input) * numpy.ones(shape): Dimensions are right alignment; Two corresponding dimensions must have the same value, or one of them is equal to 1. Also, this operator is similar to numpy.broadcast_to(input, shape), but the major difference is numpy.broadcast_to() does not allow shape to be smaller than input.size(). It is possible that the output.shape is not equal to shape, when some dimensions in shape is equal to 1, or the shape.ndim &lt; input.shape.ndim.</p>

<dl id="_ee33b6a1-cc35-d55b-642a-8afcaaa25ab0"><dt>Domain</dt>
<dd id="_a5f96b5d-cbf1-8aa5-1045-bcc5335d3d72"><p id="_9f33e214-a3d6-1623-da14-c246b49b5941"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_1052e69b-a67c-7006-119d-53d55da4b3dc"><p id="_0e9ad319-4ee2-736f-5b38-6744ae2e82de">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_42e27b9a-f810-4aa4-10ca-2c492a67b93b"><p id="_445eb266-f9b9-7310-56af-ac772195b5f9">8</p>
</dd>
<dt>Inputs</dt>
<dd id="_d9fd4e91-fb0f-ea62-acf1-fa97a097ac67"><p id="_245784fd-8a49-dd65-e2d4-a91660addd9a"><tt>input (differentiable) : T</tt> — Input tensor<br/> <tt>shape (non-differentiable) : tensor(int64)</tt> — A 1-D tensor indicates the shape you want to expand to, following the broadcast rule</p>
</dd>
<dt>Outputs</dt>
<dd id="_0b5a0363-66dd-50af-bea8-ff9a2174ed31"><p id="_b7ad87d4-70da-1702-1ef4-03543233ba11"><tt>output (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_9595a401-9753-34f5-aef1-d09b0a1c6a9f"><p id="_5b121116-c469-34f3-81cc-44c9507f827e">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_3d67b195-35e7-2909-9c84-68fd02cc740d"><p id="_1a73fb5f-5485-1ae6-6311-5d9e13ccc304"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input and output types to all tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_ee4cfddc-e950-afbf-b5ad-9f040b3fd7ac"><p id="_12444586-e8e7-17de-7437-9a80037689ab"><tt>test_expand_dim_changed</tt>, <tt>test_expand_dim_unchanged</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_56ba271f-0ba3-a00b-436f-9b7799b106b2"><p id="_74e876c3-3e00-8bc7-7733-a5d7f7b3e304">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_e854bbed-554f-b67e-f663-ae017841d6ee" anchor="op-ai-onnx-default-eyelike" obligation="normative">
<title id="_2c74c932-0631-c3cd-ec69-8e40f9cad68b">EyeLike</title>
<p id="_7e2797ed-9d66-c2d3-0d94-31e9ee7030dc">Generate a 2D tensor (matrix) with ones on the diagonal and zeros everywhere else. Only 2D tensors are supported, i.e. input T1 must be of rank 2. The shape of the output tensor is the same as the input tensor. The data type can be specified by the ‘dtype’ argument. If ‘dtype’ is not specified, then the type of input tensor is used. By default, the main diagonal is populated with ones, but attribute ‘k’ can be used to populate upper or lower diagonals. The ‘dtype’ argument must be one of the data types specified in the ‘DataType’ enum field in the TensorProto message and be valid as an output type.</p>

<dl id="_89cbcea1-5f43-26c8-a7dc-9ce06bca5709"><dt>Domain</dt>
<dd id="_100778e5-e0f6-3975-0d7e-6d4fd7dcc76e"><p id="_ddb73b47-00d6-2a61-5f68-746c39ecd68b"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_a8eb4720-f31c-da93-89ee-2c9fdda60e87"><p id="_06a6ed81-a7f9-5a9a-64a9-a1eb1f917b4f">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_af67aeea-8699-322e-1a5e-3185abaad35d"><p id="_f3cb71dc-0243-5b8d-f710-006ad84a55f9">9</p>
</dd>
<dt>Inputs</dt>
<dd id="_b3911480-5b34-a71e-65ec-6a93d5730c07"><p id="_38d0bc02-fbaa-7524-c81f-e36c9e827053"><tt>input : T1</tt> — 2D input tensor to copy shape, and optionally, type information from.</p>
</dd>
<dt>Outputs</dt>
<dd id="_0b098240-61f5-98fc-278e-cc8b6d8148d7"><p id="_bcd1481b-a943-b13d-1fc7-3128c2c1196c"><tt>output : T2</tt> — Output tensor, same shape as input tensor T1.</p>
</dd>
<dt>Attributes</dt>
<dd id="_b9273ca3-1e79-ea52-4f8f-7fe6c282066d"><p id="_f8e55b70-ea89-db45-541c-78aa7e03ed2c"><tt>dtype : int</tt> — (Optional) The data type for the elements of the output tensor. If not specified, the data type of the input tensor T1 is used.<br/> <tt>k : int (default is 0)</tt> — (Optional) Index of the diagonal to be populated with ones. Default is 0. If T2 is the output, this op sets T2[i, i+k] = 1. k = 0 populates the main diagonal, k &gt; 0 populates an upper diagonal, and k &lt; 0 populates a lower diagonal.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_890ea407-a3a8-d562-3678-7b9eae97521b"><p id="_80f27a1e-577c-6fac-53f3-a8542271be82"><tt>T1 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(bool)</tt> — Constrain input types. Strings and complex are not supported.<br/> <tt>T2 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(bool)</tt> — Constrain output types. Strings and complex are not supported.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_9e46f49a-5a03-bbc8-f6a9-f4b0434daebc"><p id="_ff09d253-0ed6-785d-5849-c3aea4a01a46"><tt>test_eyelike_populate_off_main_diagonal</tt>, <tt>test_eyelike_with_dtype</tt>, <tt>test_eyelike_without_dtype</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_48ad771d-c19e-9787-bb4d-ad41d28668f7"><p id="_2c2cc9cb-ea2b-8325-c6bd-4af499271178">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_38e93490-6f43-e09d-bd30-74413b935108" anchor="op-ai-onnx-default-flatten" obligation="normative">
<title id="_991adc08-7176-759d-bbbd-7131be766927">Flatten</title>
<p id="_92821457-8e9e-e02f-9415-83d480b37174">Flattens the input tensor into a 2D matrix. If input tensor has shape (d_0, d_1, …​ d_n) then the output will have shape (d_0 X d_1 …​ d_(axis-1), d_axis X d_(axis+1) …​ X dn).</p>

<dl id="_f8ecb034-92d0-4f35-990d-6bc2b4e30f4e"><dt>Domain</dt>
<dd id="_e4137c03-12f7-7a4f-4e2c-f9198e1775eb"><p id="_d5ef110d-199e-cc29-7893-6b640a4c6a75"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_39e91b71-ce89-36c9-8907-f65855aa0d7e"><p id="_eb386dc3-3b53-d809-4537-3b4e08c75264">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_bb3378cc-71af-a291-4161-d89e794c3431"><p id="_1a274b89-735e-9ce8-de89-f74aac8e3c1f">1, 9, 11, 13, 21, 23, 24</p>
</dd>
<dt>Inputs</dt>
<dd id="_3c52b428-d10c-d7b2-9954-e1e5e22e658a"><p id="_58d5ab00-6237-b03c-c1e0-a30a3dfa7d8b"><tt>input (differentiable) : T</tt> — A tensor of rank &gt;= axis.</p>
</dd>
<dt>Outputs</dt>
<dd id="_d8f862e3-1d8f-aac0-b6cd-5f5395d3bf68"><p id="_082fe724-c6c7-a517-be1d-539152cace01"><tt>output (differentiable) : T</tt> — A 2D tensor with the contents of the input tensor, with input dimensions up to axis flattened to the outer dimension of the output and remaining input dimensions flattened into the inner dimension of the output.</p>
</dd>
<dt>Attributes</dt>
<dd id="_d08a534c-a5bc-6db1-6ce2-0677c43ddd8b"><p id="_e2c2998a-24ef-9d05-e421-b8a7ace0dae9"><tt>axis : int (default is 1)</tt> — Indicate up to which input dimensions (exclusive) should be flattened to the outer dimension of the output. The value for axis must be in the range [-r, r], where r is the rank of the input tensor. Negative value means counting dimensions from the back. When axis = 0, the shape of the output tensor is (1, (d_0 X d_1 …​ d_n), where the shape of the input tensor is (d_0, d_1, …​ d_n).</p>
</dd>
<dt>Type constraints</dt>
<dd id="_f75dc946-2e25-b0f6-808f-d4f2fbb2a3c2"><p id="_e3e1b744-2589-48b7-e18d-a6a3cd5d0a35"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2)</tt> — Constrain input and output to all tensor types up to IRv13.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_6c408890-61bf-cf05-67c0-f5f8aa416c0a"><p id="_45848ef1-edb4-015f-0f38-24ab2fd0091e"><tt>test_flatten_axis</tt>, <tt>test_flatten_negative_axis</tt>, <tt>test_flatten_default_axis</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_a0dfc698-1fb9-6ee3-eff1-24092fe70978"><p id="_a41a30a5-af32-d6cd-6047-258b2ea3f068">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_b7635d8c-3e08-dccd-d629-0a51d5eedea6" anchor="op-ai-onnx-default-floor" obligation="normative">
<title id="_d9105426-a13e-4c4b-d0fa-0872df4f31e3">Floor</title>
<p id="_377c3439-6136-d025-c445-5f4ba87ca56f">Floor takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the floor is, y = floor(x), is applied to the tensor elementwise. If x is integral, +0, -0, NaN,  or infinite, x itself is returned.</p>

<dl id="_9a31d8ab-1099-7cbd-f3d8-94462c5935d6"><dt>Domain</dt>
<dd id="_4129dc70-80ed-4a9c-00a9-568aec20d93d"><p id="_c1032073-3237-330d-28d9-5d6c3d9962bb"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_6d267260-f198-a0b2-56ae-2773bcc8a5f6"><p id="_8629ebe5-e3df-7429-5704-1f5e09496a70">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_86069843-f30b-974a-5956-aa1772f21409"><p id="_5ccc93b7-a151-7573-4e49-bd6de073b072">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_feffac7b-800e-44e7-37e7-84d05e3abbc6"><p id="_d1a66854-1f6b-6062-c30d-ae05434ff707"><tt>X (non-differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_f0596495-a525-3031-e09a-e3d1835697f9"><p id="_7a530ab2-c190-bc82-4192-40ed127fb607"><tt>Y (non-differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_bbf4ca8e-28e5-2256-2663-0bd46e8f41d1"><p id="_5d62710d-605d-f7c2-8b16-3b0b7b8cf55c">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_1debd51a-3fc4-da20-4e69-b106cd6095b4"><p id="_04fc06ee-373b-10c4-90e3-8617feae27c9"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_6a6f730e-5237-5dd7-2f4f-7af4832e6a76"><p id="_10d38da9-7b41-70c0-6135-9c511284eb4b"><tt>test_floor_example</tt>, <tt>test_floor</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_e96b66c2-c400-4fb4-83bb-84b7267d0267"><p id="_2f983fce-cb8d-84d4-b180-82c3035fdb0c">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_2505df9b-41a2-9f96-6022-4f0267aa1efd" anchor="op-ai-onnx-default-gru" obligation="normative">
<title id="_b84ef97a-a0cd-c56e-8085-6c72badea3bc">GRU</title>
<p id="_3a8944cc-15ef-b058-4f9c-f3533543b17b">Computes an one-layer GRU. This operator is usually supported via some custom implementation such as CuDNN.</p>

<p id="_9bbc03e0-c320-5c96-c3f2-054f84084955">Notations:</p>

<ul id="_2c79a747-4ae8-5703-d1f6-4035ab4ab843"><li><p id="_dc57b9c9-45da-1c25-5639-e6911a79e6b6"><tt>X</tt> — input tensor</p>
</li>
<li><p id="_d92cb438-8e2f-c622-3c10-cd86c9b3172e"><tt>z</tt> — update gate</p>
</li>
<li><p id="_589771d1-c952-4839-b65e-cb58c0c94cdb"><tt>r</tt> — reset gate</p>
</li>
<li><p id="_c36a2df6-3177-e780-602a-5183714ab732"><tt>h</tt> — hidden gate</p>
</li>
<li><p id="_9322f499-6025-2241-c4ab-d13775efaf38"><tt>t</tt> — time step (t-1 means previous time step)</p>
</li>
<li><p id="_c0f0987e-af07-5cdd-ef62-77c16243f29c"><tt>W[zrh]</tt> — W parameter weight matrix for update, reset, and hidden gates</p>
</li>
<li><p id="_fdfd9d8d-c9c1-8606-14ee-6593ee59d2b6"><tt>R[zrh]</tt> — R recurrence weight matrix for update, reset, and hidden gates</p>
</li>
<li><p id="_fdeeecf7-b316-55ab-74ee-6c0bf6604522"><tt>Wb[zrh]</tt> — W bias vectors for update, reset, and hidden gates</p>
</li>
<li><p id="_c9eece2a-77b1-3c73-72a5-77f0033fc663"><tt>Rb[zrh]</tt> — R bias vectors for update, reset, and hidden gates</p>
</li>
<li><p id="_c3cddb28-1b64-2f1d-82e1-4c813de698f2"><tt>WB[zrh]</tt> — W parameter weight matrix for backward update, reset, and hidden gates</p>
</li>
<li><p id="_0fca0c19-dea8-791e-6407-cf57f49c8064"><tt>RB[zrh]</tt> — R recurrence weight matrix for backward update, reset, and hidden gates</p>
</li>
<li><p id="_da64ff99-09d9-ada8-04ec-5385adf1e3a6"><tt>WBb[zrh]</tt> — W bias vectors for backward update, reset, and hidden gates</p>
</li>
<li><p id="_64a2e57a-7943-1316-ee20-eca78aee025f"><tt>RBb[zrh]</tt> — R bias vectors for backward update, reset, and hidden gates</p>
</li>
<li><p id="_3c5fc6ed-fa9d-8e60-761e-2b43ced3aaa9"><tt>H</tt> — Hidden state</p>
</li>
<li><p id="_f63ea928-5ebb-63b0-4e72-122214eee727"><tt>num_directions</tt> — 2 if direction == bidirectional else 1</p>
</li>
</ul>

<p id="_346528f5-16d5-3326-b4b9-cc577bba45a5">Activation functions:</p>

<ul id="_8d40ba6e-ae34-8677-9ae0-f7ec2c1e44e0"><li><p id="_1060bac1-97ff-0cac-9bca-c951f3f56468">Relu(x)                — max(0, x)</p>
</li>
<li><p id="_9ee31687-2832-1332-025f-e4f342663efe">Tanh(x)                — (1 — e^{-2x})/(1 + e^{-2x})</p>
</li>
<li><p id="_19b56c4b-1f26-ba9d-48f9-1ff73f4dd089">Sigmoid(x)             — 1/(1 + e^{-x})</p>
</li>
</ul>

<p id="_f35658d1-45b7-20e7-7d4a-1e531b39d344">NOTE:   Below are optional</p>

<ul id="_0410ed86-6586-8034-e26e-aa4972947804"><li><p id="_457ae2e0-cd75-af82-44fa-59f83a66c56d">Affine(x)              — alpha * x + beta</p>
</li>
<li><p id="_7f3745a8-a1e6-0d49-b576-0ea6f83f45c4">LeakyRelu(x)           — x if x &gt;= 0 else alpha * x</p>
</li>
<li><p id="_47ba5207-1a91-9004-6360-3fa1821698a4">ThresholdedRelu(x)     — x if x &gt;= alpha else 0</p>
</li>
<li><p id="_66576574-b1f1-49c3-56bf-744cd7d462c7">ScaledTanh(x)          — alpha * Tanh(beta * x)</p>
</li>
<li><p id="_9be6efeb-1f05-7773-6277-3bc0172bd63c">HardSigmoid(x)         — min(max(alpha * x + beta, 0), 1)</p>
</li>
<li><p id="_c91e6fe8-d90a-de05-ebfd-3a6eb01a44b6">Elu(x)                 — x if x &gt;= 0 else alpha * (e^x — 1)</p>
</li>
<li><table id="_b7ca7f8e-3148-4bd1-49d4-744bfb24ad36">
<name id="_2bf6984d-802c-a9df-c637-ce1349657880">Table from the upstream description of <tt>GRU</tt></name>
<tbody><tr id="_9a4e00f3-b338-347a-ecf5-58b2e0549e20"><td id="_2b1aff8d-b84a-31fe-c0fa-2797e58e9b06" valign="top" align="left">Softsign(x)            — x/(1<br/></td>
<td id="_b5a46d27-2e6d-14f6-f28a-2d4bb7c9037f" valign="top" align="left">x</td>
<td id="_004d668a-c7ec-71ca-5052-8b5ed1d7eb08" valign="top" align="left">)</td>
</tr></tbody>
</table>
</li>
<li><p id="_cd095aad-8b46-5449-ce79-5eed8fa6ed2a">Softplus(x)            — log(1 + e^x)</p>
</li>
</ul>

<p id="_cf0ad61b-59f6-57d3-3cdc-e83a38d23d70">Equations (Default: f=Sigmoid, g=Tanh):</p>

<ul id="_3879a41c-0677-be85-7fbc-63b6ff66bfa7"><li><p id="_0afc6513-03ed-f9c4-842a-1b2aaf49d2cf">zt = f(Xt<em>(Wz^T) + Ht-1</em>(Rz^T) + Wbz + Rbz)</p>
</li>
<li><p id="_7772be8d-28ca-ae80-a39e-674f4c7c067f">rt = f(Xt<em>(Wr^T) + Ht-1</em>(Rr^T) + Wbr + Rbr)</p>
</li>
<li><p id="_16653f37-6ccd-c1aa-e7b9-3203476f339a">ht = g(Xt<em>(Wh^T) + (rt (.) Ht-1)</em>(Rh^T) + Rbh + Wbh) # default, when linear_before_reset = 0</p>
</li>
<li><p id="_74cb257f-9241-998b-20b5-c5dd7989a106">ht = g(Xt<em>(Wh^T) + (rt (.) (Ht-1</em>(Rh^T) + Rbh)) + Wbh) # when linear_before_reset != 0</p>
</li>
<li><p id="_46e289b3-ea44-ed34-f817-80706c183ccd">Ht = (1 — zt) (.) ht + zt (.) Ht-1 This operator has  <strong>optional</strong> inputs/outputs. See the doc for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument’s name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.</p>
<dl id="_25c9b4fe-77ae-f25f-dc4a-f272f64a7ede"><dt>Domain</dt>
<dd id="_dba7c552-ae2b-da9c-65a7-118d3f14f03f"><p id="_f7c997d3-fc99-b105-77bc-f9f9440ca898"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_52f260e9-3c91-b2e5-857f-73fbdaabd2ea"><p id="_8e2bf9c3-9bb8-eefb-0c94-1991e37cc63a">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_6489babb-e36a-958f-8425-258932733660"><p id="_2647c26d-1f26-6fca-e6d1-2d9cf62b7b19">1, 3, 7, 14</p>
</dd>
<dt>Inputs (3 — 6)</dt>
<dd id="_8999e827-d889-ca12-7f6d-46a845d9e845"><p id="_c4030c67-88b1-1664-02f3-ebbed63194e6"><tt>X (differentiable) : T</tt> — The input sequences packed (and potentially padded) into one 3-D tensor with the shape of <tt>[seq_length, batch_size, input_size]</tt>.<br/> <tt>W (differentiable) : T</tt> — The weight tensor for the gates. Concatenation of <tt>W[zrh]</tt> and <tt>WB[zrh]</tt> (if bidirectional) along dimension 0. This tensor has shape <tt>[num_directions, 3*hidden_size, input_size]</tt>.<br/> <tt>R (differentiable) : T</tt> — The recurrence weight tensor. Concatenation of <tt>R[zrh]</tt> and <tt>RB[zrh]</tt> (if bidirectional) along dimension 0. This tensor has shape <tt>[num_directions, 3*hidden_size, hidden_size]</tt>.<br/> <tt>B (optional, differentiable) : T</tt> — The bias tensor for the gates. Concatenation of <tt>[Wb[zrh], Rb[zrh]]</tt> and <tt>[WBb[zrh], RBb[zrh]]</tt> (if bidirectional) along dimension 0. This tensor has shape <tt>[num_directions, 6*hidden_size]</tt>. Optional: If not specified — assumed to be 0<br/> <tt>sequence_lens (optional, non-differentiable) : T1</tt> — Optional tensor specifying lengths of the sequences in a batch. If not specified — assumed all sequences in the batch to have length <tt>seq_length</tt>. It has shape <tt>[batch_size]</tt>.<br/> <tt>initial_h (optional, non-differentiable) : T</tt> — Optional initial value of the hidden. If not specified — assumed to be 0. It has shape <tt>[num_directions, batch_size, hidden_size]</tt>.</p>
</dd>
<dt>Outputs (0 — 2)</dt>
<dd id="_ca0de8d6-dcc1-137f-a8be-bda887ad9124"><p id="_9d187a79-9c0f-38cc-b473-ec10acd4b273"><tt>Y (optional, differentiable) : T</tt> — A tensor that concats all the intermediate output values of the hidden. It has shape <tt>[seq_length, num_directions, batch_size, hidden_size]</tt>.<br/> <tt>Y_h (optional, differentiable) : T</tt> — The last output value of the hidden. It has shape <tt>[num_directions, batch_size, hidden_size]</tt>.</p>
</dd>
<dt>Attributes</dt>
<dd id="_84183939-ed8e-27ee-1f74-e7aaa8abe3b0"><p id="_7c3fca71-e496-f4dd-04de-eb14cc2b65da"><tt>activation_alpha : list of floats</tt> — Optional scaling values used by some activation functions. The values are consumed in the order of activation functions, for example (f, g, h) in LSTM. Default values are the same as of corresponding ONNX operators.For example with LeakyRelu, the default alpha is 0.01.<br/> <tt>activation_beta : list of floats</tt> — Optional scaling values used by some activation functions. The values are consumed in the order of activation functions, for example (f, g, h) in LSTM. Default values are the same as of corresponding ONNX operators.<br/> <tt>activations : list of strings</tt> — A list of 2 (or 4 if bidirectional) activation functions for update, reset, and hidden gates. The activation functions must be one of the activation functions specified above. Optional: See the equations for default if not specified.<br/> <tt>clip : float</tt> — Cell clip threshold. Clipping bounds the elements of a tensor in the range of [-threshold, +threshold] and is applied to the input of activations. No clip if not specified.<br/> <tt>direction : string (default is forward)</tt> — Specify if the RNN is forward, reverse, or bidirectional. Must be one of forward (default), reverse, or bidirectional.<br/> <tt>hidden_size : int</tt> — Number of neurons in the hidden layer<br/> <tt>layout : int (default is 0)</tt> — The shape format of inputs X, initial_h and outputs Y, Y_h. If 0, the following shapes are expected: X.shape = [seq_length, batch_size, input_size], Y.shape = [seq_length, num_directions, batch_size, hidden_size], initial_h.shape = Y_h.shape = [num_directions, batch_size, hidden_size]. If 1, the following shapes are expected: X.shape = [batch_size, seq_length, input_size], Y.shape = [batch_size, seq_length, num_directions, hidden_size], initial_h.shape = Y_h.shape = [batch_size, num_directions, hidden_size].<br/> <tt>linear_before_reset : int (default is 0)</tt> — When computing the output of the hidden gate, apply the linear transformation before multiplying by the output of the reset gate.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_ae260136-5ee7-0563-857d-3a07a7f00842"><p id="_21960cf7-b625-b984-7aed-a14ba7a696fe"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.<br/> <tt>T1 : tensor(int32)</tt> — Constrain seq_lens to integer tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_0ef90c28-1dab-1896-29e7-5f1c28838487"><p id="_bb4e9126-936a-5804-e0fe-0a553d22d74a"><tt>test_gru_batchwise</tt>, <tt>test_gru_bidirectional</tt>, <tt>test_gru_defaults</tt>, <tt>test_gru_with_initial_bias</tt>, <tt>test_gru_reverse</tt>, <tt>test_gru_seq_length</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_e74ec339-9a5b-bbd8-8083-5e901fcf443f"><p id="_5fbe1da7-3309-baeb-9017-9fc1da69fcd2">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</li>
</ul>
</clause>

<clause id="_50bc51ff-33ff-6bc6-b142-0d99e5b6e073" anchor="op-ai-onnx-default-gather" obligation="normative">
<title id="_340a2a12-7fbc-6ef2-4313-c6ea96e18669">Gather</title>
<p id="_7a1b0fc3-e09a-2fba-039a-8244d782faaa">Given <tt>data</tt> tensor of rank r &gt;= 1, and <tt>indices</tt> tensor of rank q, gather entries of the axis dimension of  <tt>data</tt> (by default outer-most one as axis=0) indexed by <tt>indices</tt>, and concatenates them in an output tensor of rank q + (r — 1).</p>

<p id="_504a2190-5108-d378-9cfa-f5d930543c68">It is an indexing operation that indexes into the input <tt>data</tt> along a single (specified) axis. Each entry in  <tt>indices</tt> produces a <tt>r-1</tt> dimensional slice of the input tensor. The entire operation produces, conceptually, a  <tt>q</tt>-dimensional tensor of <tt>r-1</tt> dimensional slices, which is arranged into a  <tt>q + (r-1)</tt>-dimensional tensor, with the <tt>q</tt> dimensions taking the place of the original  <tt>axis</tt> that is being indexed into.</p>

<p id="_ca3eab65-5c16-e580-16c4-32aaa031b5a8">The following few examples illustrate how <tt>Gather</tt> works for specific shapes of <tt>data</tt>, <tt>indices</tt>, and given value of <tt>axis</tt>: | data shape | indices shape | axis | output shape | output equation | | — | — | — | — | — | | (P, Q) | ( )  (a scalar)   | 0 | (Q)       | output[q] = data[indices, q] | | (P, Q, R) | ( )  (a scalar)   | 1 | (P, R)       | output[p, r] = data[p, indices, r] | | (P, Q) | (R, S) | 0 | (R, S, Q) | output[r, s, q] = data[ [indices[r, s], q] | | (P, Q) | (R, S) | 1 | (P, R, S) | output[p, r, s] = data[ p, indices[r, s]] |</p>

<p id="_025d411a-7ee6-d572-9668-4752e928298f">More generally, if <tt>axis = 0</tt>, let <tt>k = indices[i_{0}, ..., i_{q-1}]</tt> then  <tt>output[i_{0}, ..., i_{q-1}, j_{0}, ..., j_{r-2}] = input[k , j_{0}, ..., j_{r-2}]</tt>:</p>

<sourcecode id="_799cb67b-da3e-7a1c-f146-224e13be849b" unnumbered="true"><body>data = [
    [1.0, 1.2],
    [2.3, 3.4],
    [4.5, 5.7],
]
indices = [
    [0, 1],
    [1, 2],
]
output = [
    [
        [1.0, 1.2],
        [2.3, 3.4],
    ],
    [
        [2.3, 3.4],
        [4.5, 5.7],
    ],
]</body></sourcecode>


<p id="_59f52f70-0f71-378b-09ae-4ea71c6f0b38">If <tt>axis = 1</tt>, let <tt>k = indices[i_{0}, ..., i_{q-1}]</tt> then  <tt>output[j_{0}, i_{0}, ..., i_{q-1}, j_{1}, ..., j_{r-2}] = input[j_{0}, k, j_{1}, ..., j_{r-2}]</tt>:</p>

<sourcecode id="_0235aa07-fd49-d9e6-d17f-8216a79c1e74" unnumbered="true"><body>data = [
    [1.0, 1.2, 1.9],
    [2.3, 3.4, 3.9],
    [4.5, 5.7, 5.9],
]
indices = [
    [0, 2],
]
axis = 1,
output = [
        [[1.0, 1.9]],
        [[2.3, 3.9]],
        [[4.5, 5.9]],
]</body></sourcecode>


<dl id="_6a76ef1d-3b12-c8cd-23e0-2ab284166a3e"><dt>Domain</dt>
<dd id="_0164c879-d38b-ca90-b0a5-6a6140e492e9"><p id="_0f8372f0-647e-24ed-e369-1d1a09cd0099"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_ca6a8e47-612a-7d39-2a6e-81d11196c622"><p id="_b20c299b-7ecb-16a7-c448-4bc447d53e55">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_ea7964bc-9707-ff63-7de2-091728247e0c"><p id="_ee12721a-c963-c995-d8d7-5582194bde5a">1, 11</p>
</dd>
<dt>Inputs</dt>
<dd id="_204da5fa-0868-c6b8-aee7-dbda15fb9913"><p id="_6b025b01-5f40-31a1-9cc8-2f078e85e7cc"><tt>data (differentiable) : T</tt> — Tensor of rank r &gt;= 1.<br/> <tt>indices (non-differentiable) : Tind</tt> — Tensor of int32/int64 indices, of any rank q. All index values are expected to be within bounds [-s, s-1] along axis of size s. It is an error if any of the index values are out of bounds.</p>
</dd>
<dt>Outputs</dt>
<dd id="_79e4cd90-daca-6111-fa8d-eb6cecb5f74d"><p id="_bd24a17c-625d-c2d3-e82e-835027d301ce"><tt>output (differentiable) : T</tt> — Tensor of rank q + (r — 1).</p>
</dd>
<dt>Attributes</dt>
<dd id="_72201cb2-e1f5-a90a-8f52-4a3b61efee56"><p id="_baee6f93-459e-567a-8ee0-36eb82f46d3b"><tt>axis : int (default is 0)</tt> — Which axis to gather on. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(data).</p>
</dd>
<dt>Type constraints</dt>
<dd id="_162e4561-5916-e442-713a-0276d05f6b54"><p id="_e8c78f98-b4aa-e63c-f4a7-5f3f513e7ba7"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input and output types to any tensor type.<br/> <tt>Tind : tensor(int32), tensor(int64)</tt> — Constrain indices to integer types</p>
</dd>
<dt>Test vectors</dt>
<dd id="_be57c51a-b32b-3839-0554-e73e28df8cb8"><p id="_d99a299a-97dc-09f4-c6e1-aebcdfb7a933"><tt>test_gather_0</tt>, <tt>test_gather_1</tt>, <tt>test_gather_2d_indices</tt>, <tt>test_gather_negative_indices</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_bee8b6cb-5f6d-064d-adc3-0ab232d15eee"><p id="_b423f1d9-011e-9d91-5d19-f8ec11cae87a">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_dd48386f-2f3c-4b5c-6ea2-4e3ffaa4bdec" anchor="op-ai-onnx-default-gatherelements" obligation="normative">
<title id="_0d9deeb7-0969-4d04-0ba8-5aaa7a30827f">GatherElements</title>
<p id="_ce9db5d6-4739-e4fd-2d68-703ec8a4e119">GatherElements takes two inputs <tt>data</tt> and <tt>indices</tt> of the same rank r &gt;= 1 and an optional attribute  <tt>axis</tt> that identifies an axis of <tt>data</tt> (by default, the outer-most axis, that is axis 0). It is an indexing operation that produces its output by indexing into the input data tensor at index positions determined by elements of the  <tt>indices</tt> tensor. Its output shape is the same as the shape of  <tt>indices</tt> and consists of one value (gathered from the  <tt>data</tt>) for each element in <tt>indices</tt>.</p>

<p id="_ddf204bc-916d-9643-ca06-2f9ac1d05fdf">For instance, in the 3-D case (r = 3), the output produced is determined by the following equations:</p>

<sourcecode id="_48918b78-4bde-547a-d175-29b1b4cbf287" unnumbered="true"><body>out[i][j][k] = input[index[i][j][k]][j][k] if axis = 0,
out[i][j][k] = input[i][index[i][j][k]][k] if axis = 1,
out[i][j][k] = input[i][j][index[i][j][k]] if axis = 2,</body></sourcecode>


<p id="_f8428c4e-e77a-aa91-6dd8-f9dc90c5137b">This operator is also the inverse of ScatterElements. It is similar to Torch’s gather operation.</p>

<p id="_2f64d631-520e-8d34-7456-30ffd1473d4c">Example 1:</p>

<sourcecode id="_fd2f323b-8d74-6f70-84a1-b7b863e0e40d" unnumbered="true"><body>data = [
    [1, 2],
    [3, 4],
]
indices = [
    [0, 0],
    [1, 0],
]
axis = 1
output = [
    [1, 1],
    [4, 3],
]</body></sourcecode>


<p id="_5596f0d8-7134-2421-4567-9abf83f8dde4">Example 2:</p>

<sourcecode id="_c3bcf800-08fb-0284-4222-f8d85306e8ad" unnumbered="true"><body>data = [
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9],
]
indices = [
    [1, 2, 0],
    [2, 0, 0],
]
axis = 0
output = [
    [4, 8, 3],
    [7, 2, 3],
]</body></sourcecode>


<dl id="_4c4224c1-8d8a-6dd2-9d89-87c2624a05d2"><dt>Domain</dt>
<dd id="_c9b02638-92f7-2d2c-1cd5-64c8dee87e94"><p id="_3e62301b-7f0f-7292-0dd7-090383319487"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_0d7bb669-1401-d68e-5209-6fa93278767d"><p id="_53e81aca-ae98-a0e3-04aa-7ff35c2b181c">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_1f55d8fa-4e70-126a-2068-1b2a08af3ed5"><p id="_c7291c56-ad0c-ba82-e171-918afbf5bbf6">11</p>
</dd>
<dt>Inputs</dt>
<dd id="_316e603c-1db6-f5c0-7b35-f7ae76f29d8f"><p id="_4712f76f-b472-0bd7-cc65-a97cf5799a26"><tt>data (differentiable) : T</tt> — Tensor of rank r &gt;= 1.<br/> <tt>indices (non-differentiable) : Tind</tt> — Tensor of int32/int64 indices, with the same rank r as the input. All index values are expected to be within bounds [-s, s-1] along axis of size s. It is an error if any of the index values are out of bounds.</p>
</dd>
<dt>Outputs</dt>
<dd id="_bb7c682a-8c98-cece-06dd-3f717d4d21d1"><p id="_53eb714d-0e2c-3ea8-4417-c4e29ddc0696"><tt>output (differentiable) : T</tt> — Tensor of the same shape as indices.</p>
</dd>
<dt>Attributes</dt>
<dd id="_f06ef84c-b5bb-3c5d-7a5d-927f65ec42eb"><p id="_3c283a6c-7557-e817-f49e-a92715ca97d2"><tt>axis : int (default is 0)</tt> — Which axis to gather on. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(data).</p>
</dd>
<dt>Type constraints</dt>
<dd id="_5113a4ae-37c8-a8ec-db7a-319afeafe6b2"><p id="_950bf4d9-0a30-977d-c33e-d55495e8a4b5"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input and output types to any tensor type.<br/> <tt>Tind : tensor(int32), tensor(int64)</tt> — Constrain indices to integer types</p>
</dd>
<dt>Test vectors</dt>
<dd id="_86a633cb-ab7c-b5c8-e5aa-ca18e6d194c7"><p id="_2cd6a790-3e09-7cfd-0b6a-64d074118948"><tt>test_gather_elements_0</tt>, <tt>test_gather_elements_1</tt>, <tt>test_gather_elements_negative_indices</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_fbc26f3f-5524-80c2-1ac1-d47e0c0ac215"><p id="_7573e932-3f55-5fe3-a371-be0ff913054b">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_fed1f3cc-2dc3-8a79-1fc6-525171c4abf6" anchor="op-ai-onnx-default-gathernd" obligation="normative">
<title id="_6e61d9c0-1746-afa2-0f61-4ad67e9ff649">GatherND</title>
<p id="_e2c314e5-de0e-c47a-1229-94e603237d4e">Given <tt>data</tt> tensor of rank <tt>r</tt> &gt;= 1, <tt>indices</tt> tensor of rank <tt>q</tt> &gt;= 1, and <tt>batch_dims</tt> integer <tt>b</tt>, this operator gathers slices of  <tt>data</tt> into an output tensor of rank <tt>q + r - indices_shape[-1] - 1 - b</tt>.</p>

<p id="_d544f008-7a30-f837-5dd4-a34503fd7b16"><tt>indices</tt> is an q-dimensional integer tensor, best thought of as a <tt>(q-1)</tt>-dimensional tensor of index-tuples into <tt>data</tt>, where each element defines a slice of  <tt>data</tt></p>

<p id="_a1d4fc25-e70d-ce35-7840-2dab5967fb1d"><tt>batch_dims</tt> (denoted as <tt>b</tt>) is an integer indicating the number of batch dimensions, i.e the leading <tt>b</tt> number of dimensions of <tt>data</tt> tensor and <tt>indices</tt> are representing the batches, and the gather starts from the <tt>b+1</tt> dimension.</p>

<p id="_3f978368-cf29-1723-e769-4c7f08291236">Some salient points about the inputs’ rank and shape:</p>

<p id="_2108e6ce-fa1a-0b2d-8bb3-5221c6f45bb5">1) r &gt;= 1 and q &gt;= 1 are to be honored. There is no dependency condition to be met between ranks <tt>r</tt> and <tt>q</tt></p>

<p id="_368d3a19-ba12-417d-93fe-46c0314fedd1">2) The first <tt>b</tt> dimensions of the shape of <tt>indices</tt> tensor and <tt>data</tt> tensor must be equal.</p>

<p id="_75e26395-ae06-81e0-4cea-01f30b5890b3">3) b &lt; min(q, r) is to be honored.</p>

<p id="_330215f9-3e46-3284-8465-0c73e63707a8">4) The <tt>indices_shape[-1]</tt> should have a value between 1 (inclusive) and rank <tt>r-b</tt> (inclusive)</p>

<p id="_fe60ba2e-7432-edf8-9ae1-44d2ea31fe11">5) All values in <tt>indices</tt> are expected to be within bounds [-s, s-1] along axis of size <tt>s</tt> (i.e.) <tt>-data_shape[i] &lt;= indices[...,i] &lt;= data_shape[i] - 1</tt>.    It is an error if any of the index values are out of bounds.</p>

<p id="_39e1c4ca-6554-6c6b-b1a8-a989106e22e0">The output is computed as follows:</p>

<p id="_10b7c286-6bfd-ff74-e1f8-d83e6ffa5f25">The output tensor is obtained by mapping each index-tuple in the <tt>indices</tt> tensor to the corresponding slice of the input <tt>data</tt>.</p>

<p id="_52e59f47-0f72-df92-04c3-401b304aa217">1) If <tt>indices_shape[-1] &gt; r-b</tt> =&gt; error condition</p>

<p id="_339989b8-63e4-bc93-6c01-dab3bbf256e7">2) If <tt>indices_shape[-1] == r-b</tt>, since the rank of <tt>indices</tt> is <tt>q</tt>, <tt>indices</tt> can be thought of as <tt>N</tt> <tt>(q-b-1)</tt>-dimensional tensors    containing 1-D tensors of dimension  <tt>r-b</tt>, where <tt>N</tt> is an integer equals to the product of 1 and all the elements in the batch dimensions    of the indices_shape. Let us think of each such  <tt>r-b</tt> ranked tensor as <tt>indices_slice</tt>. Each <em>scalar value</em> corresponding to <tt>data[0:b-1,indices_slice]</tt>    is filled into the corresponding location of the  <tt>(q-b-1)</tt>-dimensional tensor to form the <tt>output</tt> tensor (Example 1 below)</p>

<p id="_f891b284-eff5-684a-c984-8c7f587c4e31">3) If <tt>indices_shape[-1] &lt; r-b</tt>, since the rank of <tt>indices</tt> is <tt>q</tt>, <tt>indices</tt> can be thought of as <tt>N</tt> <tt>(q-b-1)</tt>-dimensional tensor    containing 1-D tensors of dimension  <tt>&lt; r-b</tt>. Let us think of each such tensors as <tt>indices_slice</tt>. Each <em>tensor slice</em> corresponding    to  <tt>data[0:b-1, indices_slice , :]</tt> is filled into the corresponding location of the <tt>(q-b-1)</tt>-dimensional tensor    to form the  <tt>output</tt> tensor (Examples 2, 3, 4 and 5 below)</p>

<p id="_4b244f49-22b4-eeee-fcc8-85610b88208e">This operator is the inverse of <tt>ScatterND</tt>.</p>

<p id="_0f1f31a0-5a6d-a06d-1982-11eb60da4ed1"><strong>Example 1</strong></p>

<sourcecode id="_d7c19e0b-bcee-bfbb-4ed1-f176d4468090" unnumbered="true"><body>batch_dims = 0
data    = [[0,1],[2,3]]   # data_shape    = [2, 2]
indices = [[0,0],[1,1]]   # indices_shape = [2, 2]
output  = [0,3]           # output_shape  = [2]</body></sourcecode>


<p id="_9109c3df-6fec-9e08-c7cd-4cca84e763ee"><strong>Example 2</strong></p>

<sourcecode id="_d5e96937-a71a-15e2-1ff5-649b77950557" unnumbered="true"><body>batch_dims = 0
data    = [[0,1],[2,3]]  # data_shape    = [2, 2]
indices = [[1],[0]]      # indices_shape = [2, 1]
output  = [[2,3],[0,1]]  # output_shape  = [2, 2]</body></sourcecode>


<p id="_a8aba402-31f3-63f5-a124-4d9edbd147e9"><strong>Example 3</strong></p>

<sourcecode id="_7078f025-de0e-1b7a-d8ed-41c27cfc56f7" unnumbered="true"><body>batch_dims = 0
data    = [[[0,1],[2,3]],[[4,5],[6,7]]] # data_shape    = [2, 2, 2]
indices = [[0,1],[1,0]]                 # indices_shape = [2, 2]
output  = [[2,3],[4,5]]                 # output_shape  = [2, 2]</body></sourcecode>


<p id="_56d2899b-d4ba-2085-1d56-915c8780f4c3"><strong>Example 4</strong></p>

<sourcecode id="_cf10b6da-18d2-6a1d-94a3-0208ebe08af8" unnumbered="true"><body>batch_dims = 0
data    = [[[0,1],[2,3]],[[4,5],[6,7]]] # data_shape    = [2, 2, 2]
indices = [[[0,1]],[[1,0]]]             # indices_shape = [2, 1, 2]
output  = [[[2,3]],[[4,5]]]             # output_shape  = [2, 1, 2]</body></sourcecode>


<p id="_cb3772ec-37f3-92d1-32b1-f23c3a6de96e"><strong>Example 5</strong></p>

<sourcecode id="_0357f8fd-6b79-3b62-127f-2ff397dbecdb" unnumbered="true"><body>batch_dims = 1
data    = [[[0,1],[2,3]],[[4,5],[6,7]]] # data_shape    = [2, 2, 2]
indices = [[1],[0]]                     # indices_shape = [2, 1]
output  = [[2,3],[4,5]]                 # output_shape  = [2, 2]</body></sourcecode>


<dl id="_5dfdcfc2-07de-9f15-236e-df7fbfdc09be"><dt>Domain</dt>
<dd id="_6af6e597-5485-d9ee-6c21-cb54be157bef"><p id="_1d70c7b3-b1fc-8ab4-ad64-9c66bf539e12"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_42b2ba76-7096-c4d1-06f3-bc635cdf1b63"><p id="_77db6e91-72f4-c07a-cf8a-618161ad0b3c">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_d6f3300e-7fc2-425f-e844-968d5bdfb36b"><p id="_f9b5dd9f-78ca-c4de-3d1c-1f298dee4727">11, 12</p>
</dd>
<dt>Inputs</dt>
<dd id="_1a0558ea-a41d-15b7-0fa7-3de0fa1a11c3"><p id="_b96f3a69-5e29-a963-3e11-b177d1780f2a"><tt>data (differentiable) : T</tt> — Tensor of rank r &gt;= 1.<br/> <tt>indices (non-differentiable) : tensor(int64)</tt> — Tensor of rank q &gt;= 1. All index values are expected to be within bounds [-s, s-1] along axis of size s. It is an error if any of the index values are out of bounds.</p>
</dd>
<dt>Outputs</dt>
<dd id="_d5be0868-22d1-4d32-6bca-64aba41920df"><p id="_2ba8dbe3-afb5-5be8-ad38-b3709f5dd7d8"><tt>output (differentiable) : T</tt> — Tensor of rank q + r — indices_shape[-1] — 1.</p>
</dd>
<dt>Attributes</dt>
<dd id="_da1fc206-3b4c-aeda-eb02-1812f7306cc2"><p id="_1d0a471d-08cf-f8ca-f3a3-ed998e457a5f"><tt>batch_dims : int (default is 0)</tt> — The number of batch dimensions. The gather of indexing starts from dimension of data[batch_dims:]</p>
</dd>
<dt>Type constraints</dt>
<dd id="_727868b9-600a-9d4c-a913-5f3e95931518"><p id="_18b40378-0862-c10f-17bd-7b00c349d3ca"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input and output types to any tensor type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_82b0ea18-54ab-d9fa-b528-0f275d5517c9"><p id="_b395d2fa-5d83-ec80-11c8-6c32275f389d"><tt>test_gathernd_example_float32</tt>, <tt>test_gathernd_example_int32</tt>, <tt>test_gathernd_example_int32_batch_dim1</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_f41578d4-8716-e8bc-b202-d860bf53d98d"><p id="_dfa1f296-82ca-9ac7-4f47-435308a7e978">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_2eeff98a-800b-30ab-0915-a1c71b489557" anchor="op-ai-onnx-default-gelu" obligation="normative">
<title id="_e0ed1717-f485-e5c8-0b84-f6df3ff28e17">Gelu</title>
<p id="_9b349153-a5b0-2b5e-a21e-77b0a714f35e">Gelu takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the gaussian error linear units function, $y = 0.5 * x * (1 + erf(x/sqrt(2)))$ is applied to the tensor elementwise. If the attribute “approximate” is set to “tanh”, the function estimation, $y = 0.5 * x * (1 + Tanh(sqrt(2/\pi) * (x + 0.044715 * x^3)))$ is used and applied to the tensor elementwise.</p>

<dl id="_5fca4b20-6d26-9d1d-39e1-715d26e0b173"><dt>Domain</dt>
<dd id="_e5b55deb-2b78-e547-522d-e20d30955c6e"><p id="_aaa8e728-9012-9171-bf30-0856e70a3e5d"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_b8c30273-018a-4193-9c27-da157c06f7bc"><p id="_f03f4a93-8826-64e0-028b-0ae6db06f6dd">20</p>
</dd>
<dt>Inputs</dt>
<dd id="_da779a8c-bc8c-cdba-ee90-2271ea6763f5"><p id="_fa9ebc64-c6b5-2784-3809-ce3d9ecf4ca2"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_bd27c586-7f10-7c80-74bc-435a89849f5f"><p id="_34a9db61-97e4-a4b5-9d22-39a28f1cddfa"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_c6987d4c-1866-13b6-6eef-9d5cbf894f83"><p id="_7484a24e-c59f-fd8a-b7a5-686856789076"><tt>approximate : string (default is none)</tt> — Gelu approximation algorithm: <tt>"tanh"</tt>, <tt>"none"</tt>(default).<tt>"none"</tt>: do not use approximation.<tt>"tanh"</tt>: use tanh approximation.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_0af52359-76cd-b84a-0671-4ab5944b3c71"><p id="_e60b1b6b-e212-74b5-bb89-48b48dfd181a"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_bb7a1a9e-5d3c-8eb4-caef-737215c0cffd"><p id="_50cac409-aac6-a0bc-541b-e4c0e2ef65b8"><tt>test_gelu_default_1</tt>, <tt>test_gelu_default_2</tt>, <tt>test_gelu_tanh_1</tt>, <tt>test_gelu_tanh_2</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_db9b1915-89a0-9c1c-6987-c90c2b3cd5f3"><p id="_89562d81-3b9b-8cc2-e18a-92d310cfee66">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_34e0e2fb-bfef-8333-a851-a42caa1d3a49" anchor="op-ai-onnx-default-gemm" obligation="normative">
<title id="_af5ae097-3e96-ae99-0bb4-47725190ab27">Gemm</title>
<p id="_73c810e7-aadc-ad43-7306-cf5d58aa6bc8">General Matrix multiplication: <link target="https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms#Level_3"/></p>

<ul id="_fa37bbfa-8aeb-e505-52c2-c985101435a1"><li><p id="_b8b5b281-a133-5c3a-3297-5c54697db0a1">A’ = transpose(A) if transA else A</p>
</li>
<li><p id="_d07988ed-3b43-e15b-9140-34e47cf56498">B’ = transpose(B) if transB else B</p>
</li>
</ul>

<p id="_6a683ea6-0958-36bd-2408-3a83e85e8988">Compute Y = alpha * A’ * B’ + beta * C, where input tensor A has shape (M, K) or (K, M), input tensor B has shape (K, N) or (N, K), input tensor C is broadcastable to shape (M, N), and output tensor Y has shape (M, N). A will be transposed before doing the computation if attribute transA is non-zero, same for B and transB. This operator supports  <strong>unidirectional broadcasting</strong> (tensor C should be unidirectional broadcastable to tensor A * B); for more details please check the doc. This operator has  <strong>optional</strong> inputs/outputs. See the doc for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument’s name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.</p>

<dl id="_94128a4d-7fcd-1319-896e-a30618c4f56d"><dt>Domain</dt>
<dd id="_b4ff7ec0-0445-9904-5d43-8250ab5182ec"><p id="_bfc293ba-4270-51e9-b6a3-5ac508c28861"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_44ea0918-5006-942d-9c0b-eb860a5af70a"><p id="_50313dcf-8681-ec3a-b44c-50e687085abe">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_67b62aa2-9f0d-a12c-c1e3-ec0efb45f9e2"><p id="_77dc32b4-afe2-39b2-bc78-1bb95b575038">1, 6, 7, 9, 11</p>
</dd>
<dt>Inputs (2 — 3)</dt>
<dd id="_a6f0d64c-a6f1-ffc4-1a3e-72e61d5bc9a4"><p id="_8562b2f5-ed7e-435f-7477-17cbf38699a3"><tt>A (differentiable) : T</tt> — Input tensor A. The shape of A should be (M, K) if transA is 0, or (K, M) if transA is non-zero.<br/> <tt>B (differentiable) : T</tt> — Input tensor B. The shape of B should be (K, N) if transB is 0, or (N, K) if transB is non-zero.<br/> <tt>C (optional, differentiable) : T</tt> — Optional input tensor C. If not specified, the computation is done as if C is a scalar 0. The shape of C should be unidirectional broadcastable to (M, N).</p>
</dd>
<dt>Outputs</dt>
<dd id="_6ff06d34-7cf2-904f-18ea-eea09e0af41c"><p id="_1c248497-fd5b-3b39-523b-bd7c29fc1775"><tt>Y (differentiable) : T</tt> — Output tensor of shape (M, N).</p>
</dd>
<dt>Attributes</dt>
<dd id="_89aa3ee0-7f0f-8575-7c81-497cfb5a2902"><p id="_d8752e39-d0a8-f2c0-859f-de68031edbcb"><tt>alpha : float (default is 1.0)</tt> — Scalar multiplier for the product of input tensors A * B.<br/> <tt>beta : float (default is 1.0)</tt> — Scalar multiplier for input tensor C.<br/> <tt>transA : int (default is 0)</tt> — Whether A should be transposed<br/> <tt>transB : int (default is 0)</tt> — Whether B should be transposed</p>
</dd>
<dt>Type constraints</dt>
<dd id="_7e36228a-62b8-c04e-d9d5-eea5a8381132"><p id="_39467b89-8c95-e085-da30-5c123cf26fad"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(uint32), tensor(uint64), tensor(int32), tensor(int64), tensor(bfloat16)</tt> — Constrain input and output types to float/int tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_0d1d96e4-0b03-f6de-9202-876cbcf28172"><p id="_bc7ac7cb-77f8-bf12-d05d-fb6dfbe41885"><tt>test_gemm_all_attributes</tt>, <tt>test_gemm_alpha</tt>, <tt>test_gemm_beta</tt>, <tt>test_gemm_default_matrix_bias</tt>, <tt>test_gemm_default_no_bias</tt>, <tt>test_gemm_default_scalar_bias</tt>, <tt>test_gemm_default_single_elem_vector_bias</tt>, <tt>test_gemm_default_vector_bias</tt>, <tt>test_gemm_default_zero_bias</tt>, <tt>test_gemm_transposeA</tt>, <tt>test_gemm_transposeB</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_4a5f260d-ce06-3801-cb84-bd3dae5da294"><p id="_151e595e-cce6-e77a-0866-f5b77f107e21">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_0bd44c19-ecef-ffb9-d7e9-a4f908ff9e6d" anchor="op-ai-onnx-default-globalaveragepool" obligation="normative">
<title id="_6f571710-4555-2e64-76c3-4ffbaf595bd2">GlobalAveragePool</title>
<p id="_a8ddc30c-ce33-8cd4-4f8c-5d7bec7e654a">GlobalAveragePool consumes an input tensor X and applies average pooling across  the values in the same channel. This is equivalent to AveragePool with kernel size  equal to the spatial dimension of input tensor.</p>

<dl id="_e5bcaafd-64b6-a74e-e23a-34cf041d54a0"><dt>Domain</dt>
<dd id="_a088cacb-e5a0-891b-5e3b-5776ca1eab3b"><p id="_a1e4e424-5758-9e45-2803-9aceed988adf"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_d569d32d-fb89-da21-23c8-202bc0c7f12b"><p id="_5c917e8b-de49-29a7-b141-038fc043fe6e">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_c7ed3df1-94f3-45ce-4af8-a99170ef9585"><p id="_0c57c0b3-d0c8-b114-1c3a-701bda7de392">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_a7068ed1-5376-20c8-9c05-9befaec8db3c"><p id="_87ef8f4e-384d-9cf6-fce2-eb04398acd4a"><tt>X (differentiable) : T</tt> — Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 …​ Dn), where N is the batch size.</p>
</dd>
<dt>Outputs</dt>
<dd id="_9784c35e-5530-3f28-0a89-ab66c23f525c"><p id="_f38784cb-36d9-e639-a3c7-81a9986c8d88"><tt>Y (differentiable) : T</tt> — Output data tensor from pooling across the input tensor. The output tensor has the same rank as the input. The first two dimensions of output shape are the same as the input (N x C), while the other dimensions are all 1.</p>
</dd>
<dt>Attributes</dt>
<dd id="_7d58e1e1-46e1-add3-1747-e88b7ac63f94"><p id="_0e2865dc-960a-59d6-0ce5-9aea79604ecb">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_9b3c6da6-19c3-31f3-d915-9dcffa4ed18a"><p id="_86868cf2-0b0f-464d-540a-87503d52cbe8"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_939eb2c5-9949-093a-0553-9c9c8e7d3c19"><p id="_ca627187-34c3-7100-f3bd-f6f2f2b6f314"><tt>test_globalaveragepool</tt>, <tt>test_globalaveragepool_precomputed</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_eb8ecae9-e8ee-520e-1193-2c762450b051"><p id="_9973ba52-a261-23b9-a0b2-db02cc45ce04">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_f51b1f54-36d8-18f5-e686-cf5a09986fe4" anchor="op-ai-onnx-default-globallppool" obligation="normative">
<title id="_fbd3a8dd-f79d-aa39-a9d0-7c1ced447a7d">GlobalLpPool</title>
<p id="_995967a1-55a0-cc0a-7fd7-9c9d92d2222b">GlobalLpPool consumes an input tensor X and applies lp pool pooling across  the values in the same channel. This is equivalent to LpPool with kernel size  equal to the spatial dimension of input tensor.</p>

<dl id="_6a32c4a9-ceb2-8822-b0c5-f6ec82538192"><dt>Domain</dt>
<dd id="_f54b2f4d-d464-8e0d-66ba-b75854302b02"><p id="_e8c08c68-38dd-5bbe-2132-642c05869070"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_2b8e0241-a24a-e549-51ae-486b3cc5e7d0"><p id="_d2304d0f-c271-efaf-6518-43817c47a843">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_7f4efca2-f2c7-063f-b8cd-2a9a6c136b41"><p id="_22dff5f4-6191-f361-9ed7-e69e2acc3dda">1, 2</p>
</dd>
<dt>Inputs</dt>
<dd id="_8061f77b-76a6-29ba-ea7d-8fed8858ab29"><p id="_87d2fc64-7677-2053-4f9e-ea9fef742e85"><tt>X (differentiable) : T</tt> — Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 …​ Dn), where N is the batch size.</p>
</dd>
<dt>Outputs</dt>
<dd id="_816bfcfe-d648-3480-2f4b-2cf835078c03"><p id="_c6521738-e3e9-93dc-b7c2-538a807c3a8a"><tt>Y (differentiable) : T</tt> — Output data tensor from pooling across the input tensor. The output tensor has the same rank as the input. The first two dimensions of output shape are the same as the input (N x C), while the other dimensions are all 1.</p>
</dd>
<dt>Attributes</dt>
<dd id="_1c503344-bf89-5b11-0ee3-b99ac730375a"><p id="_f52595c6-8899-c9b8-bfda-715033df33af"><tt>p : int (default is 2)</tt> — p value of the Lp norm used to pool over the input data.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_9ef54b2e-0a45-fc72-aebc-d2f88910e5c4"><p id="_05893995-1fa1-a509-7a68-6fae580d070a"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_3044d3e1-dfbf-b1f0-3a81-d732169a5593"><p id="_26468848-0875-6c1d-55a3-3ba83498edc4">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_3e626203-ac48-102a-7edb-5c528fb8af3b"><p id="_274b6577-8013-06d8-e800-a81ae949fcd9">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_10995ea3-2631-7e5a-8ba5-a43398b454bc" anchor="op-ai-onnx-default-globalmaxpool" obligation="normative">
<title id="_aad80cac-8709-66e2-ecd1-09a591868edc">GlobalMaxPool</title>
<p id="_c7e03427-1ab2-f642-c968-66ea5c98ee30">GlobalMaxPool consumes an input tensor X and applies max pooling across  the values in the same channel. This is equivalent to MaxPool with kernel size  equal to the spatial dimension of input tensor.</p>

<dl id="_828e88d9-9e77-eed0-3a75-2bc88542a723"><dt>Domain</dt>
<dd id="_b1edd145-5c7b-b595-7631-341a6fc93fd8"><p id="_a30b5ff2-e653-003f-33e3-56d7bdc518f4"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_da3d649f-d51e-7a9b-8ec2-427244a7db4f"><p id="_9484cbbb-f56d-0b79-8cc8-690f6ebb169f">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_8d28d647-c805-a851-26c7-71b15bfd326b"><p id="_7043a66d-29c7-aaa8-0d4c-b79a8a439cd1">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_366a194b-5854-d153-c7fa-e8108f28c3ed"><p id="_cfc11627-f824-03db-9419-c2e4a3159508"><tt>X (differentiable) : T</tt> — Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 …​ Dn), where N is the batch size.</p>
</dd>
<dt>Outputs</dt>
<dd id="_21bb8d80-af3b-c207-92a8-852293457c34"><p id="_d2f1c797-5152-3c11-4cf4-fa30c6d5d968"><tt>Y (differentiable) : T</tt> — Output data tensor from pooling across the input tensor. The output tensor has the same rank as the input. The first two dimensions of output shape are the same as the input (N x C), while the other dimensions are all 1.</p>
</dd>
<dt>Attributes</dt>
<dd id="_489a971a-0819-7d2c-fc56-41867fa36b87"><p id="_a256415e-7177-3586-e5ce-2fb0cf711f02">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_57f4c29e-7879-2288-0877-190e6ee13b5d"><p id="_611c0f97-e7bb-5464-b3f5-176eadeb5d3a"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_84cd0db7-83e1-4da1-b861-71d6fd656615"><p id="_6e73782a-ada5-16dc-7a29-97ed6e86756e"><tt>test_globalmaxpool</tt>, <tt>test_globalmaxpool_precomputed</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_351d686c-8326-7741-1e1f-6e6596ed238c"><p id="_9aa0d340-77b2-b40e-702f-50bf9a1b4f6f">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_418a5ae8-3a3c-577d-28bd-3579076be9c7" anchor="op-ai-onnx-default-greater" obligation="normative">
<title id="_c2b4b8c0-37d2-e6fc-cf09-f42588987b19">Greater</title>
<p id="_73eb2310-5903-6000-1d79-3022038df471">Returns the tensor resulted from performing the <tt>greater</tt> logical operation elementwise on the input tensors  <tt>A</tt> and <tt>B</tt> (with Numpy-style broadcasting support).</p>

<p id="_a67fd843-a18e-6f16-4f53-61b33fcdfe9d">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_a054207f-f85f-a708-50ec-72884db67ee8"><dt>Domain</dt>
<dd id="_baf72a5a-2716-12d1-3ee8-b4e43acc0687"><p id="_6c37bdcb-3449-c982-7242-4869a33f1810"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_bac09845-1460-bc1c-521c-b2af6852042e"><p id="_6ef13628-6d25-cae2-1b8e-cef886e9e15f">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_2b72e9db-de48-69bf-dec5-88d7054c31d2"><p id="_44514950-3760-498c-9ea8-5d26b8001a49">1, 7, 9</p>
</dd>
<dt>Inputs</dt>
<dd id="_9ad64841-e9cc-d51a-6790-0ddb8699bb79"><p id="_594173d1-fb76-d7a1-f5ce-1d8025cec79c"><tt>A (non-differentiable) : T</tt> — First input operand for the logical operator.<br/> <tt>B (non-differentiable) : T</tt> — Second input operand for the logical operator.</p>
</dd>
<dt>Outputs</dt>
<dd id="_7539008f-68a5-c5c3-ecab-7c378131e2f7"><p id="_8e3e6b89-9769-5bb0-7187-7503761abd73"><tt>C (non-differentiable) : T1</tt> — Result tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_18957ccf-ee47-1efc-fd09-04c2a452d9ed"><p id="_ddc1b075-1835-8ad5-799c-91a101f055fd">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_8a32a619-28b7-e214-06ec-619581af3b8f"><p id="_e205b905-3925-dd19-0060-2b05de25d8ab"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input types to all numeric tensors.<br/> <tt>T1 : tensor(bool)</tt> — Constrain output to boolean tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_39fdbbdd-0ee6-4cab-aa4e-661df0b2f3d3"><p id="_7430e831-8863-ae77-3f84-291de4fae5d2"><tt>test_greater</tt>, <tt>test_greater_int8</tt>, <tt>test_greater_int16</tt>, <tt>test_greater_uint8</tt>, <tt>test_greater_uint16</tt>, <tt>test_greater_uint32</tt>, <tt>test_greater_uint64</tt>, <tt>test_greater_bcast</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_4a089e31-1ceb-8d16-51ac-77d850324073"><p id="_dd5e6f1e-cdc3-67f9-e18d-7dc9c1a4ba85">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_23749ae1-e63d-e082-5615-b47da9831609" anchor="op-ai-onnx-default-greaterorequal" obligation="normative">
<title id="_b345eef7-159c-86e3-6dc3-09a0fa30b387">GreaterOrEqual</title>
<p id="_87cd204d-967c-4a3a-4f22-cc29aebbf948">Returns the tensor resulted from performing the <tt>greater_equal</tt> logical operation elementwise on the input tensors  <tt>A</tt> and <tt>B</tt> (with Numpy-style broadcasting support).</p>

<p id="_9a8045e5-9b96-618b-3f52-44e3ac734669">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_fe18a843-8b5f-5612-9a4c-fcd193330ae5"><dt>Domain</dt>
<dd id="_c839292b-af8d-b848-d731-d86a989581ad"><p id="_211cb576-cbf7-705c-2637-bfb93434558b"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_9162b7e7-ea50-638a-6676-ea794c2f3ec5"><p id="_8d8cc73d-d22c-b3d1-a0fb-a267af121fd3">16</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_dfb17275-78ff-1d7f-f725-34eeaeded679"><p id="_a77ddc72-07e8-fc80-a7f4-1a38f7937e36">12</p>
</dd>
<dt>Inputs</dt>
<dd id="_293d8115-8a20-2296-7014-836ad9b6c528"><p id="_a7b39256-007c-de11-1811-cd7cc6922c74"><tt>A (non-differentiable) : T</tt> — First input operand for the logical operator.<br/> <tt>B (non-differentiable) : T</tt> — Second input operand for the logical operator.</p>
</dd>
<dt>Outputs</dt>
<dd id="_62fea357-6ce8-e187-56be-398ff69ed991"><p id="_7ee79581-126a-74c6-f688-7e0af0df6100"><tt>C (non-differentiable) : T1</tt> — Result tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_b48c17e9-4e89-cba3-dcbd-e18fcadc0b50"><p id="_d8773cc7-344c-1278-7df0-4d01ad69a319">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_82a783c2-a559-487f-db43-0f02847cdd7e"><p id="_9cdb12c2-659f-714f-555f-0e3e5ab02e21"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input types to all numeric tensors.<br/> <tt>T1 : tensor(bool)</tt> — Constrain output to boolean tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_260fe10b-b548-abae-2692-0c5a967b75d7"><p id="_ad598340-45c0-7907-350a-92ee4b020b87"><tt>test_greater_equal_bcast</tt>, <tt>test_greater_equal</tt>, <tt>test_greater_equal_int8</tt>, <tt>test_greater_equal_int16</tt>, <tt>test_greater_equal_uint8</tt>, <tt>test_greater_equal_uint16</tt>, <tt>test_greater_equal_uint32</tt>, <tt>test_greater_equal_uint64</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_7881d6b3-3017-18a0-e083-1ba49f34f8d5"><p id="_af33dadb-d3f1-45b5-4795-1d278cf47b2b">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_1a0cf3e3-353b-922d-9174-b24c35aeab66" anchor="op-ai-onnx-default-gridsample" obligation="normative">
<title id="_75d8f724-409c-90b9-e165-a6cf76e4a058">GridSample</title>
<p id="_bb48d51a-8a95-72c4-fb27-c8ed278cce0c">Given an input <tt>X</tt> and a flow-field <tt>grid</tt>, computes the output <tt>Y</tt> using <tt>X</tt> values and pixel locations from the <tt>grid</tt>. For spatial input  <tt>X</tt> with shape (N, C, H, W), the <tt>grid</tt> will have shape (N, H_out, W_out, 2), the output  <tt>Y</tt> will have shape (N, C, H_out, W_out). For volumetric input <tt>X</tt> with shape (N, C, D, H, W), the  <tt>grid</tt> will have shape (N, D_out, H_out, W_out, 3), the output <tt>Y</tt> will have shape (N, C, D_out, H_out, W_out). More generally, for an input  <tt>X</tt> of rank r+2 with shape (N, C, d1, d2, …​, dr), the  <tt>grid</tt> will have shape (N, D1_out, D2_out, …​, Dr_out, r), the output <tt>Y</tt> will have shape (N, C, D1_out, D2_out, …​, Dr_out).</p>

<p id="_6b2146de-e1f9-4230-9848-cf83f4970d94">The tensor <tt>X</tt> contains values at centers of square pixels (voxels, etc) locations such as (n, c, d1_in, d2_in, …​, dr_in). The (n, d1_out, d2_out, …​, dr_out, :) values from the tensor  <tt>grid</tt> are the normalized positions for interpolating the values at the (n, c, d1_out, d2_out, …​, dr_out) locations from the output tensor  <tt>Y</tt> using a specified interpolation method (the mode) and a padding mode (for  <tt>grid</tt> positions falling outside the 2-dimensional image).</p>

<p id="_31ecc613-9543-f172-0813-20a686d5eb72">For example, the values in <tt>grid[n, h_out, w_out, :]</tt> are size-2 vectors specifying normalized positions in the 2-dimensional space of <tt>X</tt>. They are used to interpolate output values of  <tt>Y[n, c, h_out, w_out]</tt>.</p>

<p id="_fb62cc54-ad24-bbd0-9cce-ae763729b8f7">The GridSample operator is often used in doing grid generator and sampler in the <link target="https://arxiv.org/abs/1506.02025">Spatial Transformer Networks</link>. See also in  <link target="https://pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html">torch.nn.functional.grid_sample</link>.</p>

<dl id="_ca965db1-f6bf-bd73-d719-7bc8f08be2c2"><dt>Domain</dt>
<dd id="_3d5acd6f-d947-18a2-7847-b936d030d222"><p id="_4cc61e3b-ed2f-93a1-dc81-0b5fbc447fd5"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_f9a6f4ab-b7e4-e99a-6272-19f3e0d3975a"><p id="_56b6fc7b-3a33-ede8-5dea-a90a50dbdc9c">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_aecf1dce-b120-3eb0-4daf-0695b4de49d9"><p id="_50b99f99-2bf1-5f6f-b6fa-d6d64dd987d3">16, 20</p>
</dd>
<dt>Inputs</dt>
<dd id="_8c02c97f-8cd9-d095-1ea5-e6457a688c3a"><p id="_fbc5a772-19a5-fc4b-b3fb-a88e91221594"><tt>X (differentiable) : T1</tt> — Input tensor of rank r+2 that has shape (N, C, D1, D2, …​, Dr), where N is the batch size, C is the number of channels, D1, D2, …​, Dr are the spatial dimensions.<br/> <tt>grid (non-differentiable) : T2</tt> — Input offset of shape (N, D1_out, D2_out, …​, Dr_out, r), where D1_out, D2_out, …​, Dr_out are the spatial dimensions of the grid and output, and r is the number of spatial dimensions. Grid specifies the sampling locations normalized by the input spatial dimensions. Therefore, it should have most values in the range of [-1, 1]. If the grid has values outside the range of [-1, 1], the corresponding outputs will be handled as defined by padding_mode. Following computer vision convention, the coordinates in the length-r location vector are listed from the innermost tensor dimension to the outermost, the opposite of regular tensor indexing.</p>
</dd>
<dt>Outputs</dt>
<dd id="_0629cb7d-5ae1-a1d5-2a10-27fa33b50890"><p id="_c72f36c9-8936-e88f-9fb4-c6e107c6ba92"><tt>Y (differentiable) : T1</tt> — Output tensor of rank r+2 that has shape (N, C, D1_out, D2_out, …​, Dr_out) of the sampled values. For integer input types, intermediate values are computed as floating point and cast to integer at the end.</p>
</dd>
<dt>Attributes</dt>
<dd id="_1a142162-3d11-caaa-dc5f-aaa1c1935117"><p id="_3c9fd547-3582-0aef-6346-3626867874ae"><tt>align_corners : int (default is 0)</tt> — If align_corners=1, the extrema (-1 and 1) are considered as referring to the center points of the input’s corner pixels (voxels, etc.). If align_corners=0, they are instead considered as referring to the corner points of the input’s corner pixels (voxels, etc.), making the sampling more resolution agnostic.<br/> <tt>mode : string (default is linear)</tt> — Three interpolation modes: linear (default), nearest and cubic. The “linear” mode includes linear and N-linear interpolation modes depending on the number of spatial dimensions of the input tensor (i.e. linear for 1 spatial dimension, bilinear for 2 spatial dimensions, etc.). The “cubic” mode also includes N-cubic interpolation modes following the same rules. The “nearest” mode rounds to the nearest even index when the sampling point falls halfway between two indices.<br/> <tt>padding_mode : string (default is zeros)</tt> — Support padding modes for outside grid values: <tt>zeros</tt>(default), <tt>border</tt>, <tt>reflection</tt>. zeros: use 0 for out-of-bound grid locations, border: use border values for out-of-bound grid locations, reflection: use values at locations reflected by the border for out-of-bound grid locations. If index 0 represents the margin pixel, the reflected value at index -1 will be the same as the value at index 1. For location far away from the border, it will keep being reflected until becoming in bound. If pixel location x = -3.5 reflects by border -1 and becomes x’ = 1.5, then reflects by border 1 and becomes x’’ = 0.5.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_671aa9ae-1c36-4c70-2266-863c57001dfc"><p id="_b9802f01-fd63-893f-ba4b-656db78ddac4"><tt>T1 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input <tt>X</tt> and output <tt>Y</tt> types to all tensor types.<br/> <tt>T2 : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain grid types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_0f45bd55-0a7d-cc5e-3f24-797616ac4891"><p id="_d13df7fc-fb85-aa74-411f-4074883f2888"><tt>test_gridsample</tt>, <tt>test_gridsample_bilinear</tt>, <tt>test_gridsample_aligncorners_true</tt>, <tt>test_gridsample_nearest</tt>, <tt>test_gridsample_bicubic</tt>, <tt>test_gridsample_nearest_align_corners_0_additional_1</tt>, <tt>test_gridsample_nearest_align_corners_1_additional_1</tt>, <tt>test_gridsample_bilinear_align_corners_0_additional_1</tt>, <tt>test_gridsample_bilinear_align_corners_1_additional_1</tt>, <tt>test_gridsample_bicubic_align_corners_0_additional_1</tt>, <tt>test_gridsample_bicubic_align_corners_1_additional_1</tt>, <tt>test_gridsample_zeros_padding</tt>, <tt>test_gridsample_border_padding</tt>, <tt>test_gridsample_reflection_padding</tt>, <tt>test_gridsample_volumetric_nearest_align_corners_0</tt>, <tt>test_gridsample_volumetric_nearest_align_corners_1</tt>, <tt>test_gridsample_volumetric_bilinear_align_corners_0</tt>, <tt>test_gridsample_volumetric_bilinear_align_corners_1</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_0b094a1f-301a-08b2-020d-42ea04733541"><p id="_37ee4908-5ea7-8833-00e4-2dfe1a3f46d7">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_f753c557-efb0-3e53-11bc-3c3dc2d9cdbd" anchor="op-ai-onnx-default-groupnormalization" obligation="normative">
<title id="_7e548efc-dd47-2a60-cc69-5f9387aa5aaf">GroupNormalization</title>
<p id="_c748be22-aee6-15fc-f5be-940bf811d1a6">A GroupNormalization function. Carries out group normalization as described in the paper  <link target="https://arxiv.org/abs/1803.08494"/></p>

<p id="_85955ee7-1b88-8238-e99e-afa58d63d165">This operator transforms input according to</p>

<sourcecode id="_cf48dd40-4f4b-b9ec-7403-f82932c8cf90" unnumbered="true"><body>y = scale * (x - mean) / sqrt(variance + epsilon) + bias,</body></sourcecode>


<p id="_b4aad1bb-7f10-50cf-2d9e-e7c411046a68">where the mean and variance are computed per instance per group of channels, and <tt>scale</tt> and <tt>bias</tt> should be specified for each channel. The number of groups  <tt>num_groups</tt> should be divisible by the number of channels so that there are an equal number of channels per group.</p>

<p id="_3aa66606-89c4-9100-18bf-b4a2b22bdf9c">The overall computation has two stages: the first stage normalizes the elements to have zero mean and unit variance for each instance in each group, and the second stage scales and shifts the results of the first stage. The floating-point precision used in the first stage is determined by the  <tt>stash_type</tt> attribute. For example, if  <tt>stash_type</tt> is 1, the operator casts all input variables to 32-bit float, performs the computation, and finally casts the normalized results back to the original type of  <tt>X</tt>. The second stage does not depend on <tt>stash_type</tt>.</p>

<p id="_ab6306b7-22bc-503e-c7a4-27afd21e2fb4">When the number of groups is the same as the number of channels, this operator is equivalent to InstanceNormalization. When there is only one group, this operator is equivalent to LayerNormalization.</p>

<dl id="_1d771c45-a493-d3ee-4afc-052d30b219e1"><dt>Domain</dt>
<dd id="_3e435e43-f1b0-fac7-4151-d6b31c90d2a7"><p id="_90116732-194d-655b-9e4f-a348df4f9540"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_a5e8c996-8b71-e0a4-2257-538c88588d4e"><p id="_e4308551-0330-8143-6e1d-7897009adc7b">21</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_c0f3bcf3-5175-7dc8-8a42-e4dc81fbbbb1"><p id="_dc372b8f-4935-41cc-c869-1d40a3983ea9">18</p>
</dd>
<dt>Inputs</dt>
<dd id="_00443c2e-0c37-dcf0-68fe-ccfd8cb05322"><p id="_cdd31941-52d5-8b02-e78f-222acfc92f9d"><tt>X (differentiable) : T</tt> — Input data tensor. Dimensions for image cases are <tt>(N x C x H x W)</tt>, where <tt>N</tt> is the batch size, <tt>C</tt> is the number of channels, and <tt>H</tt> and <tt>W</tt> are the height and width of the data. Statistics are computed for every group of channels over <tt>C</tt>, <tt>H</tt>, and <tt>W</tt>. For non-image cases, the dimensions are in the form of <tt>(N x C x D1 x D2 ... Dn)</tt>.<br/> <tt>scale (differentiable) : T</tt> — Scale tensor of shape <tt>(C)</tt>.<br/> <tt>bias (differentiable) : T</tt> — Bias tensor of shape <tt>(C)</tt>.</p>
</dd>
<dt>Outputs</dt>
<dd id="_e8b13c61-6a6c-1323-401b-f7976e6c397d"><p id="_906a5937-04d5-9265-2587-ca73bdb1809b"><tt>Y (differentiable) : T</tt> — The output tensor of the same shape as <tt>X</tt>.</p>
</dd>
<dt>Attributes</dt>
<dd id="_cabcca02-ed35-663a-fa4a-a4ad849f3f3b"><p id="_51b94987-683f-8702-7dae-749d73b898ec"><tt>epsilon : float (default is 1e-05)</tt> — The epsilon value to use to avoid division by zero.<br/> <tt>num_groups : int (required)</tt> — The number of groups of channels. It should be a divisor of the number of channels <tt>C</tt>.<br/> <tt>stash_type : int (default is 1)</tt> — The floating-point precision used in stage one of the computation.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_034990e0-96a5-3ddf-40eb-3a910526cf4e"><p id="_2d185ab0-a519-a7bf-ee98-1bf73c80f8ad"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_c3c630c9-cab6-0707-13c8-0753b0a93e4d"><p id="_e9246eb3-3331-e248-f748-baf88f44555a"><tt>test_group_normalization_epsilon</tt>, <tt>test_group_normalization_example</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_8335ad7f-2985-8b61-f76d-637c52303b06"><p id="_e74d4186-acdf-044b-3d30-67b0659db112">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_d927318a-bc32-4004-beed-2e452b92b166" anchor="op-ai-onnx-default-hammingwindow" obligation="normative">
<title id="_befaca25-2709-c72d-6cd3-a35cc95abb4e">HammingWindow</title>
<p id="_be57179e-783e-5f7a-b540-7576392705d3">Generates a Hamming window as described in the paper <link target="https://ieeexplore.ieee.org/document/1455106"/>.</p>

<dl id="_993fb440-2d9d-70ac-b3a6-4f441d890328"><dt>Domain</dt>
<dd id="_86bb04a1-d3ae-cc36-7be9-b22927fa2c10"><p id="_bafc265d-ffb3-5f83-0bca-2e2b5830b647"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_1c0bc2cb-1c33-a22c-284d-d03e5dc6f500"><p id="_36da7782-784e-4694-b276-1aad202643e1">17</p>
</dd>
<dt>Inputs</dt>
<dd id="_3720fbc7-7ccf-8788-1f11-c33d36d3abdc"><p id="_8383dd6e-572c-1b34-f59a-2977768e71f2"><tt>size (non-differentiable) : T1</tt> — A scalar value indicating the length of the window.</p>
</dd>
<dt>Outputs</dt>
<dd id="_09659758-8dc4-16b5-455d-bcc213c34fce"><p id="_cfe1f2c3-31c3-6054-3814-adbedb594a33"><tt>output (non-differentiable) : T2</tt> — A Hamming window with length: size. The output has the shape: [size].</p>
</dd>
<dt>Attributes</dt>
<dd id="_12a89585-6dd0-7a7c-c8fa-0749f532dc4e"><p id="_c1f5595a-dc92-41c1-1d55-a763e6460bdf"><tt>output_datatype : int (default is 1)</tt> — The data type of the output tensor. Strictly must be one of the values from DataType enum in TensorProto whose values correspond to T2. The default value is 1 = FLOAT.<br/> <tt>periodic : int (default is 1)</tt> — If 1, returns a window to be used as periodic function. If 0, return a symmetric window. When ‘periodic’ is specified, hann computes a window of length size + 1 and returns the first size points. The default value is 1.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_b287e58d-8441-5adb-4c42-e338c1850bb3"><p id="_64d14be6-47f5-f90d-b5fc-db3416a4a7ce"><tt>T1 : tensor(int32), tensor(int64)</tt> — Constrain the input size to int32_t or int64_t.<br/> <tt>T2 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain output types to numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_79f2530d-63c0-a582-ce5b-6a595e295993"><p id="_86afed83-91cf-8e94-1315-791a164a24b6"><tt>test_hammingwindow</tt>, <tt>test_hammingwindow_symmetric</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_3ffd50b9-cd6b-f5df-804f-ca0f5e9aa0d0"><p id="_d1d5394c-b7e0-79a5-ae12-73f862461217">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_6080d4f7-9f53-b104-0e30-f3d073beff70" anchor="op-ai-onnx-default-hannwindow" obligation="normative">
<title id="_e0ad4ff4-a90a-7cd8-9388-bf1bd5daec3c">HannWindow</title>
<p id="_362a8040-6625-3095-690f-a9f89d501454">Generates a Hann window as described in the paper <link target="https://ieeexplore.ieee.org/document/1455106"/>.</p>

<dl id="_ba613838-1125-e816-a420-cb6ad3bb7e16"><dt>Domain</dt>
<dd id="_faca2f05-2692-0ca4-811e-af4fa6c55a57"><p id="_c8a74528-7b06-5dbd-4dbe-5eafcf05332e"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_b3d56621-1a84-89e5-d4b8-766fc02e21ec"><p id="_0d0b7970-ada0-5a49-dcb4-c7c26adbf30a">17</p>
</dd>
<dt>Inputs</dt>
<dd id="_341687b0-3608-952d-5eab-6e5d2c89fc92"><p id="_a9670108-0724-29e1-810a-6c0c4303aa50"><tt>size (non-differentiable) : T1</tt> — A scalar value indicating the length of the window.</p>
</dd>
<dt>Outputs</dt>
<dd id="_8f9b9b16-ce2c-b0cf-761e-a4869a188bb4"><p id="_c4577349-3d66-6998-2a3c-d948a8f86af6"><tt>output (non-differentiable) : T2</tt> — A Hann window with length: size. The output has the shape: [size].</p>
</dd>
<dt>Attributes</dt>
<dd id="_e37e71f3-476d-b312-d5e1-b756710f3602"><p id="_64134288-e82e-1ae7-9a97-35bb72a5a6f5"><tt>output_datatype : int (default is 1)</tt> — The data type of the output tensor. Strictly must be one of the values from DataType enum in TensorProto whose values correspond to T2. The default value is 1 = FLOAT.<br/> <tt>periodic : int (default is 1)</tt> — If 1, returns a window to be used as periodic function. If 0, return a symmetric window. When ‘periodic’ is specified, hann computes a window of length size + 1 and returns the first size points. The default value is 1.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_fd43dcb0-78b9-e512-6cdc-88577b954a84"><p id="_26c14d70-efed-7f95-d4ea-6d6e09ce1fc7"><tt>T1 : tensor(int32), tensor(int64)</tt> — Constrain the input size to int32_t or int64_t.<br/> <tt>T2 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain output types to numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_d53c55e7-092a-77ce-e4d0-12d0f24d94d9"><p id="_92cb210c-3b1c-de80-f7f1-d9b2fce39e7a"><tt>test_hannwindow</tt>, <tt>test_hannwindow_symmetric</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_ea9b71c7-c7ef-266e-aba1-04f3ac9b5424"><p id="_92f520a1-ea6f-1b1a-a39b-9966cae058b5">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_4d81e35f-e06c-2459-f235-d90fe7dc3c7e" anchor="op-ai-onnx-default-hardsigmoid" obligation="normative">
<title id="_1d0e351f-73cd-9152-e430-8a6ad79ed83f">HardSigmoid</title>
<p id="_de9c2488-c096-eba4-a620-0f638f28c0e5">HardSigmoid takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the HardSigmoid function, y = max(0, min(1, alpha * x + beta)), is applied to the tensor elementwise.</p>

<dl id="_1bde029b-11f9-d472-6592-2c30211c844a"><dt>Domain</dt>
<dd id="_64c3bd37-18e9-afdf-f5db-60b92993a53d"><p id="_6b2bfa6b-0345-1ae7-6a14-5463d5293e9b"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_855f05c6-2679-30a8-665a-6487fc33a4b0"><p id="_d78b7da9-3447-214a-1fad-e3828a4a8ee3">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_fdd5dbb8-c233-80e8-c2f2-609aa3982550"><p id="_8c62fe99-e5b0-705b-61f7-5b4d691e8746">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_09a08200-9326-ec11-5d77-344a357c55cc"><p id="_07d69dc3-3367-eba1-6f07-e54719c8e8cd"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_a2a4c8ed-deb8-72e6-fcda-aeb417e55079"><p id="_fb771f29-e899-bc88-b36c-6d123f7269d8"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_c779ccc9-35f2-4623-1251-f19d5a7da6eb"><p id="_3b2b8fb4-120c-7a80-c782-5db396241697"><tt>alpha : float (default is 0.2)</tt> — Value of alpha.<br/> <tt>beta : float (default is 0.5)</tt> — Value of beta.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_52ecbb6d-c31b-4ae8-63ec-adb95972ab04"><p id="_403d49be-be96-7d01-4640-738dfde86d62"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_f0b112c4-ea04-b148-cfa0-615b32db37d5"><p id="_42468b4b-60ab-dd7e-99a6-6bfc6fc4d857"><tt>test_hardsigmoid_example</tt>, <tt>test_hardsigmoid</tt>, <tt>test_hardsigmoid_default</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_3e9e3544-2e9b-7a06-2601-6278c0ea097e"><p id="_0bf93f1a-f4c2-645f-9915-c3ccd074ef5a">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_7935629e-fa28-ab80-0904-bceb543ea436" anchor="op-ai-onnx-default-hardswish" obligation="normative">
<title id="_52725e3f-0fcc-43f6-97fb-02b53f23686b">HardSwish</title>
<p id="_65389067-2cb9-a225-1fd7-d37c21809ef1">HardSwish takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the HardSwish function, y = x * max(0, min(1, alpha * x + beta)) = x *  <tt>HardSigmoid&lt;alpha, beta&gt;</tt>(x), where alpha = 1/6 and beta = 0.5, is applied to the tensor elementwise.</p>

<dl id="_ee639ed7-6740-f0c4-7796-8ee11c7aef52"><dt>Domain</dt>
<dd id="_16fd5851-f7d9-6024-6dbd-db83cdcdec1e"><p id="_dcc4eb8f-de27-3e93-8f67-a79144a6e5ed"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_13431ad8-aa00-c03d-fb76-f3264e717764"><p id="_03b6e420-d001-7f39-b2ad-a7aeed8f46b0">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_03e48ab4-19c0-5880-64ff-ee3549f2a2f4"><p id="_1f18295b-1e92-a676-9f98-04adbd32c4a9">14</p>
</dd>
<dt>Inputs</dt>
<dd id="_b4e6da36-5846-6efd-fffb-0d102d440c3a"><p id="_57818764-4071-1d51-fae9-2f52bbca0fc9"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_5e86637e-cdb9-4e75-32d1-05fada3f19c9"><p id="_47fe9dc2-3484-df4c-3905-bffecbb885c9"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_03e85e29-1782-117f-8527-a999261149ff"><p id="_193c4758-f3a3-3f34-4f24-5f4fcb40dce6">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_c5e56673-866c-331a-90fe-59994a93f638"><p id="_8f9be358-cec9-5c26-8be3-08a6c5672a64"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_9af0570c-f0dc-12f7-cabd-37152eea7920"><p id="_e50b251d-fcfe-c654-52b5-d4f63248c3fd"><tt>test_hardswish</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_79d1ed00-bd5f-1ca1-cdd5-ce061d625540"><p id="_8728b8de-ddd0-18d6-c6ee-47d3f54f12b1">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_667d6dc3-b455-8682-d38f-83f8141915a7" anchor="op-ai-onnx-default-hardmax" obligation="normative">
<title id="_1a346237-914c-c0dc-15d3-b5267943580c">Hardmax</title>
<p id="_a2aaeffe-1c23-d976-d1df-8619db7f74fc">The operator computes the hardmax values for the given input:</p>

<p id="_28ffb6df-6102-d667-1d64-c8c88691e2b8">Hardmax(element in input, axis) = 1 if the element is the first maximum value along the specified axis, 0 otherwise</p>

<p id="_e99b2890-93a5-e2d1-87d6-adf4c7dfecbe">The “axis” attribute indicates the dimension along which Hardmax will be performed. The output tensor has the same shape and contains the Hardmax values of the corresponding input.</p>

<dl id="_bcf20f3f-3632-c637-af2b-cb9b06f59feb"><dt>Domain</dt>
<dd id="_092ef97c-6ce4-c5a7-0671-1913483aa5d2"><p id="_7e838961-df04-d4a8-8709-e9ef46a28810"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_7a838c32-7d6d-aa51-af57-cebd2b33b66b"><p id="_ff0f2e39-9fac-30e4-ec9b-fd4ae6641a06">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_31dfa776-77f8-8459-7a9d-1c1f34b2aba2"><p id="_1f1d3320-e413-2b14-ce49-c9777c1f7f76">1, 11</p>
</dd>
<dt>Inputs</dt>
<dd id="_31fb23f9-1202-7a5e-9d13-3fde0d7576bd"><p id="_eb3e0ed1-d6b3-b8af-0f27-2cb6d4944f71"><tt>input (differentiable) : T</tt> — The input tensor of rank &gt;= axis.</p>
</dd>
<dt>Outputs</dt>
<dd id="_15e39561-a577-10f4-25c0-75d3e713e8c1"><p id="_b4a6f472-5f78-16c5-aefd-bf1a0ee78326"><tt>output (differentiable) : T</tt> — The output values with the same shape as the input tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_6307258f-3ffd-1bcd-d309-4b53a19f03fe"><p id="_4ba87b1d-49bc-2a2a-57f8-4065abc71060"><tt>axis : int (default is -1)</tt> — Describes the dimension Hardmax will be performed on. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(input).</p>
</dd>
<dt>Type constraints</dt>
<dd id="_abc7236a-6eaa-2971-6d49-85f2cd3d48a7"><p id="_c9fc672d-b44f-c0a2-9ddb-bd19f59261be"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_ddc63c39-35a2-ccd3-632a-35287a4aa755"><p id="_b52206e2-74b4-5f1b-be9a-74fa723debf1"><tt>test_hardmax_example</tt>, <tt>test_hardmax_one_hot</tt>, <tt>test_hardmax_axis_0</tt>, <tt>test_hardmax_axis_1</tt>, <tt>test_hardmax_axis_2</tt>, <tt>test_hardmax_negative_axis</tt>, <tt>test_hardmax_default_axis</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_69011e35-f288-2cd8-e6bd-0bc63efa0edf"><p id="_0dfab749-77a9-422d-45cb-a9a77bf35723">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_816ccb90-2cba-55df-afb0-d8d89c5781ef" anchor="op-ai-onnx-default-identity" obligation="normative">
<title id="_d61e9e73-16a3-8e69-dcfa-0ed0f83e6ff2">Identity</title>
<p id="_8e0d5143-b536-6bce-3547-ee593770605c">Identity operator</p>

<dl id="_0a998e56-b655-c8c5-8882-c338203d15e0"><dt>Domain</dt>
<dd id="_0642b95c-6313-aeff-2f8c-e3c2fd5dddd8"><p id="_488ec107-b7fb-4a53-4e11-d1cf9b596118"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_1ff2cf46-bb8e-45f5-d310-953595caf179"><p id="_bc2a0d1e-a31e-caa1-4f20-1c5730b8cd17">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_d6508f42-b785-acb7-edd9-08343babf2e8"><p id="_e5f15f2f-756b-ba78-5b42-5a595457f312">1, 13, 14, 16, 19, 21, 23, 24</p>
</dd>
<dt>Inputs</dt>
<dd id="_e45f179a-b3b6-99b3-60de-f4eab7e05acf"><p id="_02366c03-13cb-134d-4d92-70e7aac2add3"><tt>input (differentiable) : V</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_9525b5a2-f43e-d334-0da4-60bde1bb52a6"><p id="_c2d4ef8f-da05-7daa-ca35-dd27a7fa2744"><tt>output (differentiable) : V</tt> — Tensor to copy input into.</p>
</dd>
<dt>Attributes</dt>
<dd id="_f611cd68-8a86-929d-1ef7-cb5556afa1a5"><p id="_d5bd4fe3-3096-d6b9-7e34-b07697bbbb52">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_8836a645-ae02-d69a-28d5-c905b22a0855"><p id="_b9328eec-b6a6-0ec2-2e97-4f069a189748"><tt>V : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2), seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128)), optional(seq(tensor(uint8))), optional(seq(tensor(uint16))), optional(seq(tensor(uint32))), optional(seq(tensor(uint64))), optional(seq(tensor(int8))), optional(seq(tensor(int16))), optional(seq(tensor(int32))), optional(seq(tensor(int64))), optional(seq(tensor(float16))), optional(seq(tensor(float))), optional(seq(tensor(double))), optional(seq(tensor(string))), optional(seq(tensor(bool))), optional(seq(tensor(complex64))), optional(seq(tensor(complex128))), optional(tensor(uint8)), optional(tensor(uint16)), optional(tensor(uint32)), optional(tensor(uint64)), optional(tensor(int8)), optional(tensor(int16)), optional(tensor(int32)), optional(tensor(int64)), optional(tensor(float16)), optional(tensor(float)), optional(tensor(double)), optional(tensor(string)), optional(tensor(bool)), optional(tensor(complex64)), optional(tensor(complex128))</tt> — Constrain input and output types to all tensor, sequence, and optional types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_8a630cb1-bd1d-bfe3-fa23-7c539c601763"><p id="_07814f02-6347-3b07-9280-1df03d13b89a"><tt>test_identity</tt>, <tt>test_identity_opt</tt>, <tt>test_identity_sequence</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_e6f4e0c8-51dc-bc5a-e90e-10f80d966ad2"><p id="_cc769143-5a71-d674-bb5e-aeecfcd8beaa">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_728353f8-18fb-76d0-4f1a-d0b68cc985a8" anchor="op-ai-onnx-default-if" obligation="normative">
<title id="_49b9ee06-ab2a-5a73-c92f-b1dd3154cc00">If</title>
<p id="_25e3e4ca-d6dc-c695-f82b-b80d5dcd5709">If conditional</p>

<dl id="_af18194e-5588-85f0-8e62-415182bc8030"><dt>Domain</dt>
<dd id="_673c6658-a4dc-4ccb-2bfe-8f0d07e20e87"><p id="_176be946-84b8-2668-cfeb-9de019487a47"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_b9d58e1f-b9a7-7856-6ced-d60aa452fa91"><p id="_fe823b55-7424-69f6-18eb-0c4ca30f6ea2">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_ad756a0b-16a1-0d3a-7b5c-fb14af148ec9"><p id="_75e6e482-a4f0-78c0-15fa-fa37fa42b0fb">1, 11, 13, 16, 19, 21, 23, 24</p>
</dd>
<dt>Inputs</dt>
<dd id="_e0710a5e-67fa-8b7f-9009-556d0798b0ad"><p id="_4feefbc4-1fb6-be2a-bc9c-064521c734c3"><tt>cond : B</tt> — Condition for the if. The tensor must contain a single element.</p>
</dd>
<dt>Outputs (1 — unbounded)</dt>
<dd id="_a9d280b9-fc98-1aec-c055-79fe37dc6315"><p id="_cd939926-dbfb-5a20-ab6d-7d3e81cb2581"><tt>outputs (variadic, heterogeneous) : V</tt> — Values that are live-out to the enclosing scope. The return values in the <tt>then_branch</tt> and <tt>else_branch</tt> must be of the same data type. The <tt>then_branch</tt> and <tt>else_branch</tt> may produce tensors with the same element type and different shapes. If corresponding outputs from the then-branch and the else-branch have static shapes S1 and S2, then the shape of the corresponding output variable of the if-node (if present) must be compatible with both S1 and S2 as it represents the union of both possible shapes.For example, if in a model file, the first output of <tt>then_branch</tt> is typed float tensor with shape [2] and the first output of <tt>else_branch</tt> is another float tensor with shape [3], If’s first output should have (a) no shape set, or (b) a shape of rank 1 with neither <tt>dim_value</tt> nor <tt>dim_param</tt> set, or © a shape of rank 1 with a unique <tt>dim_param</tt>. In contrast, the first output cannot have the shape [2] since [2] and [3] are not compatible.</p>
</dd>
<dt>Attributes</dt>
<dd id="_cbc6ac23-5549-0335-cca1-80d90cdaad9b"><p id="_d88ab5a3-9d85-f8bf-d40f-9916fffdc1b6"><tt>else_branch : graph (required)</tt> — Graph to run if condition is false. Has N outputs: values you wish to be live-out to the enclosing scope. The number of outputs must match the number of outputs in the then_branch.<br/> <tt>then_branch : graph (required)</tt> — Graph to run if condition is true. Has N outputs: values you wish to be live-out to the enclosing scope. The number of outputs must match the number of outputs in the else_branch.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_97a0dafa-fc55-2bd3-efd2-37a43f79b1fa"><p id="_fe886fed-9e4e-69b1-d785-2d09abde9356"><tt>V : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2), seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(bfloat16)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128)), seq(tensor(float8e4m3fn)), seq(tensor(float8e4m3fnuz)), seq(tensor(float8e5m2)), seq(tensor(float8e5m2fnuz)), seq(tensor(uint4)), seq(tensor(int4)), seq(tensor(float4e2m1)), seq(tensor(float8e8m0)), seq(tensor(uint2)), seq(tensor(int2)), optional(seq(tensor(uint8))), optional(seq(tensor(uint16))), optional(seq(tensor(uint32))), optional(seq(tensor(uint64))), optional(seq(tensor(int8))), optional(seq(tensor(int16))), optional(seq(tensor(int32))), optional(seq(tensor(int64))), optional(seq(tensor(bfloat16))), optional(seq(tensor(float16))), optional(seq(tensor(float))), optional(seq(tensor(double))), optional(seq(tensor(string))), optional(seq(tensor(bool))), optional(seq(tensor(complex64))), optional(seq(tensor(complex128))), optional(tensor(uint8)), optional(tensor(uint16)), optional(tensor(uint32)), optional(tensor(uint64)), optional(tensor(int8)), optional(tensor(int16)), optional(tensor(int32)), optional(tensor(int64)), optional(tensor(bfloat16)), optional(tensor(float16)), optional(tensor(float)), optional(tensor(double)), optional(tensor(string)), optional(tensor(bool)), optional(tensor(complex64)), optional(tensor(complex128)), optional(tensor(float8e4m3fn)), optional(tensor(float8e4m3fnuz)), optional(tensor(float8e5m2)), optional(tensor(float8e5m2fnuz)), optional(tensor(uint4)), optional(tensor(int4)), optional(tensor(float4e2m1)), optional(tensor(float8e8m0)), optional(tensor(uint2)), optional(tensor(int2))</tt> — All Tensor, Sequence(Tensor), Optional(Tensor), and Optional(Sequence(Tensor)) types up to IRv13.<br/> <tt>B : tensor(bool)</tt> — Only bool</p>
</dd>
<dt>Test vectors</dt>
<dd id="_31ebe151-00ef-6863-9d02-834c606fd73b"><p id="_5de0065a-ea06-be88-56c8-e8aa494cbe70"><tt>test_if</tt>, <tt>test_if_opt</tt>, <tt>test_if_seq</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_c964845d-9131-c67b-4f74-ef5a38a4cff2"><p id="_7c125701-0b5b-7fa0-9791-58341dac4915">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_ba43d3dd-f1cb-0733-66dc-1e6c910265d8" anchor="op-ai-onnx-default-imagedecoder" obligation="normative">
<title id="_9b03195f-8728-b5c5-be04-75e792ab072c">ImageDecoder</title>
<p id="_b8bc35c0-b5c9-5147-b116-e2344a359b27">Loads and decodes and image from a file. If it can’t decode for any reason (e.g. corrupted encoded stream, invalid format, it will return an empty matrix). The following image formats are supported:</p>

<ul id="_2451efcb-3ec2-2cb2-d3e3-00602b0166d9"><li><p id="_bbd7a3bb-b4f7-5918-d976-f189d798d501">BMP</p>
</li>
<li><p id="_beafd1ef-6826-52a8-b196-b7d9c7eae284">JPEG (note: Lossless JPEG support is optional)</p>
</li>
<li><p id="_c0ecd66e-14b2-b99b-2151-4c760524716f">JPEG2000</p>
</li>
<li><p id="_404d68a0-2bf8-2997-a09c-9824aa87d68a">TIFF</p>
</li>
<li><p id="_9f1180e5-0cd3-2bf7-effc-076335e77c64">PNG</p>
</li>
<li><p id="_da462b8c-bbac-917a-f176-63f265609dd8">WebP</p>
</li>
<li><p id="_ff19fcca-f54c-06ca-384a-998f1b36eb7d">Portable image format (PBM, PGM, PPM, PXM, PNM) Decoded images follow a channel-last layout: (Height, Width, Channels). <strong>JPEG chroma upsampling method:</strong> When upsampling the chroma components by a factor of 2, the pixels are linearly interpolated so that the centers of the output pixels are 1/4 and 3/4 of the way between input pixel centers. When rounding, 0.5 is rounded down and up at alternative pixels locations to prevent bias towards larger values (ordered dither pattern). Considering adjacent input pixels A, B, and C, B is upsampled to pixels B0 and B1 so that</p>
<sourcecode id="_7b0b4bce-3e5c-0007-02a2-820dc9f48ed8" unnumbered="true"><body>B0 = round_half_down((1/4) * A + (3/4) * B)
B1 = round_half_up((3/4) * B + (1/4) * C)</body></sourcecode>


<p id="_c3a3f1f1-13e6-30d5-1a9c-5a35f2b55f0b">This method,  is the default chroma upsampling method in the well-established libjpeg-turbo library, also referred as “smooth” or “fancy” upsampling.</p>

<dl id="_eca7847e-a823-6ef2-825e-f33ab3201f20"><dt>Domain</dt>
<dd id="_11caf8c2-3f7b-843d-6532-d26ceffc1825"><p id="_80a02f8d-38a0-caf4-fca5-501c3641f49e"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_f0b4e821-e71e-de57-feb0-f69452ebb439"><p id="_fb531d5e-ff5a-3ed1-6711-4fc70d58420b">20</p>
</dd>
<dt>Inputs</dt>
<dd id="_19a80428-92fb-404a-d030-ccfc2e7ff26f"><p id="_a1535646-9374-1187-7ded-fa1457222bfb"><tt>encoded_stream (non-differentiable) : T1</tt> — Encoded stream</p>
</dd>
<dt>Outputs</dt>
<dd id="_213f2d54-1381-4118-6113-029e170e2588"><p id="_fca0270e-942c-0123-175d-9e8215aea0fe"><tt>image (non-differentiable) : T2</tt> — Decoded image</p>
</dd>
<dt>Attributes</dt>
<dd id="_163dd63a-4b72-d4c2-218c-f980a05d9c86"><p id="_079f0db9-8edb-dea1-5984-258b7a65c165"><tt>pixel_format : string (default is RGB)</tt> — Pixel format. Can be one of “RGB”, “BGR”, or “Grayscale”.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_72d44455-76d6-14cd-a53a-7989f69e98c7"><p id="_c69c608c-393f-33eb-3bfc-447cfbef4ad5"><tt>T1 : tensor(uint8)</tt> — Constrain input types to 8-bit unsigned integer tensor.<br/> <tt>T2 : tensor(uint8)</tt> — Constrain output types to 8-bit unsigned integer tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_889ad43d-1258-0185-6c65-a5c380479010"><p id="_a905124e-0b2e-a2b4-f8a1-0662712e7c13"><tt>test_image_decoder_decode_bmp_rgb</tt>, <tt>test_image_decoder_decode_jpeg2k_rgb</tt>, <tt>test_image_decoder_decode_jpeg_bgr</tt>, <tt>test_image_decoder_decode_jpeg_grayscale</tt>, <tt>test_image_decoder_decode_jpeg_rgb</tt>, <tt>test_image_decoder_decode_png_rgb</tt>, <tt>test_image_decoder_decode_pnm_rgb</tt>, <tt>test_image_decoder_decode_tiff_rgb</tt>, <tt>test_image_decoder_decode_webp_rgb</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_28ddfbd6-508d-6211-f2ef-f9fa2a702355"><p id="_be6718ff-7d4d-6e02-8979-e3bbb688d633">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</li>
</ul>
</clause>

<clause id="_cb529006-d0dd-b9f0-8793-676319d077a1" anchor="op-ai-onnx-default-instancenormalization" obligation="normative">
<title id="_c7f48343-6127-6edb-d5c9-792d9d5f74ad">InstanceNormalization</title>
<p id="_c5130880-daff-31c4-c74a-b14d00643c4b">Carries out instance normalization as described in the paper <link target="https://arxiv.org/abs/1607.08022"/>.</p>

<p id="_98dd903d-7bb0-a158-d995-dd75ec81fb26">y = scale * (x — mean) / sqrt(variance + epsilon) + B, where mean and variance are computed per instance per channel.</p>

<dl id="_421b00c0-52fb-0b21-7716-56cb82b1802b"><dt>Domain</dt>
<dd id="_218b560f-3aba-1bb0-044e-b3516c16dffa"><p id="_ac6ab20e-6ba1-2c79-a325-8915222f6331"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_91abe194-9fdf-e10b-378a-74c2e65d38f1"><p id="_31fe9ffc-8d2f-bcdb-4a4e-2059629d9ec3">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_086fc8d0-fbf5-d26e-fb75-2db2c7a0f194"><p id="_44ab131b-f63f-08ed-bd8e-1e71f10bcef7">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_dd00c325-f085-e6e3-bb91-7fd3bda35e0d"><p id="_25959778-1b39-afc8-4807-838c719abc96"><tt>input (differentiable) : T</tt> — Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 …​ Dn), where N is the batch size.<br/> <tt>scale (differentiable) : T</tt> — The input 1-dimensional scale tensor of size C.<br/> <tt>B (differentiable) : T</tt> — The input 1-dimensional bias tensor of size C.</p>
</dd>
<dt>Outputs</dt>
<dd id="_df8313f5-c5b6-f196-42de-14d3cb4b365d"><p id="_04665846-09a4-4c5c-eaf4-78d39bb8a911"><tt>output (differentiable) : T</tt> — The output tensor of the same shape as input.</p>
</dd>
<dt>Attributes</dt>
<dd id="_47d8372b-bcf1-4194-9671-2d95d4fd2af9"><p id="_a8447a78-c462-13a5-7ac9-775c33417fe9"><tt>epsilon : float (default is 1e-05)</tt> — The epsilon value to use to avoid division by zero.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_d7735af9-3ea9-37a7-57d1-333ba11926fd"><p id="_abdc5d6f-578e-0ff8-79a4-9b9b0c8ff165"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_e12bd917-08c1-01cb-84f1-75f0bbdf7112"><p id="_9e11cee5-99bb-fc85-d008-9825b03f067e"><tt>test_instancenorm_example</tt>, <tt>test_instancenorm_epsilon</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_a03e381c-b8f5-f253-8931-b75976961f6f"><p id="_6028600d-220c-40fa-d2af-56bcef1d7c5f">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_417f68fd-409e-a7c6-328b-ca33138b5600" anchor="op-ai-onnx-default-isinf" obligation="normative">
<title id="_8fb7570b-7f5d-b5d1-c42a-f49ad944a836">IsInf</title>
<p id="_77ee38d3-ce2b-3612-9eab-6db24c9b68fd">Map infinity to true and other values to false.</p>

<dl id="_7871bb26-6f78-3233-4ac1-4a112e771a5a"><dt>Domain</dt>
<dd id="_83d8a7c8-9011-f2d3-ab51-3620a19085d3"><p id="_fc3e8f2c-88c3-7094-3cc2-be2b1e3bac91"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_5e3042e7-9c74-2ab6-5e2b-e6f8875aa77a"><p id="_0aa81f63-9d8f-6a73-fc1e-2a0e5e4e9b7b">20</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_9ed5416b-a56a-4a30-7277-e764aff8b298"><p id="_738de2f7-451a-8f22-e034-4798e8951aa5">10</p>
</dd>
<dt>Inputs</dt>
<dd id="_686d6d5b-302a-608b-c356-fb9446cfd44a"><p id="_d64e5b99-245b-7a66-a2b2-a689e9e3d7ac"><tt>X (non-differentiable) : T1</tt> — input</p>
</dd>
<dt>Outputs</dt>
<dd id="_4da50547-243e-45ca-5a96-1673d196357c"><p id="_8124a53e-1e70-d4f0-9edf-e7e341624f6a"><tt>Y (non-differentiable) : T2</tt> — output</p>
</dd>
<dt>Attributes</dt>
<dd id="_aa27cd40-a181-97af-debf-6087a206ee27"><p id="_023d7b29-4cb1-c526-df2e-929e04d7fcd7"><tt>detect_negative : int (default is 1)</tt> — (Optional) Whether map negative infinity to true. Default to 1 so that negative infinity induces true. Set this attribute to 0 if negative infinity should be mapped to false.<br/> <tt>detect_positive : int (default is 1)</tt> — (Optional) Whether map positive infinity to true. Default to 1 so that positive infinity induces true. Set this attribute to 0 if positive infinity should be mapped to false.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_46715eff-78f6-d1a2-c5a8-6f40149fa48d"><p id="_f312430f-076d-56b5-c1f4-afde171391c0"><tt>T1 : tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz)</tt> — Constrain input types to float tensors.<br/> <tt>T2 : tensor(bool)</tt> — Constrain output types to boolean tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_5af915f8-90ab-4566-bf5e-6e0a176b7700"><p id="_f0ea3ece-012a-936d-a97c-a401c0c7fcb7"><tt>test_isinf</tt>, <tt>test_isinf_float16</tt>, <tt>test_isinf_negative</tt>, <tt>test_isinf_positive</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_1b550367-a8e7-4d28-ada7-8bdf5adb59d0"><p id="_bc0be97e-0990-b132-78a3-68183ece8795">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_7189f5c2-202e-4ff3-371d-2eae1b2e1180" anchor="op-ai-onnx-default-isnan" obligation="normative">
<title id="_7cd1ea2f-f464-83f5-84ab-1d4ec3961552">IsNaN</title>
<p id="_bb146c1d-b3b0-ecd8-77cd-39266ad7c159">Returns which elements of the input are NaN.</p>

<dl id="_2505220f-f41e-9498-60bd-dccc889352da"><dt>Domain</dt>
<dd id="_2f014548-a766-8574-b3a7-74025a66e82d"><p id="_aed215a6-1f74-daca-042c-5b5164099018"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_7eabc886-d641-c726-0e84-13eb14027d51"><p id="_adc3bb5f-7c21-39c2-9929-1ca843d50865">20</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_1cf00d5a-84b8-13dd-a088-ddfc549a074d"><p id="_a9dc57a0-bc50-132a-dfc6-05b744b96db9">9, 13</p>
</dd>
<dt>Inputs</dt>
<dd id="_7dd9e9b8-803f-1983-0992-ac30b6d6ad56"><p id="_a4735f02-770d-883b-6813-879097bbc70f"><tt>X (non-differentiable) : T1</tt> — input</p>
</dd>
<dt>Outputs</dt>
<dd id="_6664cd90-ab2b-b0d2-36db-516456cc8a8b"><p id="_dbc72d39-b56e-63dc-b6db-458d99d93e06"><tt>Y (non-differentiable) : T2</tt> — output</p>
</dd>
<dt>Attributes</dt>
<dd id="_2c13a537-a9b5-d8d6-17ed-721cb526d6c5"><p id="_20d2b6c7-6a09-e3ff-e884-e4d51db79183">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_563f4369-4014-06ed-10b2-c49a837307d2"><p id="_539f104d-c822-2459-6999-ba74aefdb591"><tt>T1 : tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz)</tt> — Constrain input types to float tensors.<br/> <tt>T2 : tensor(bool)</tt> — Constrain output types to boolean tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_a6d5a3c8-3ccf-91af-df62-f932f532659c"><p id="_c17e5fe4-a180-5fa9-bfad-8001652d53ae"><tt>test_isnan_float16</tt>, <tt>test_isnan</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_f871818c-b8ff-f5e5-2000-7e1e71de2116"><p id="_9ce3a9ac-9650-8da8-2736-a21bd64aa0c5">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_4de33211-49cc-afee-83c0-3608369455e9" anchor="op-ai-onnx-default-lrn" obligation="normative">
<title id="_959926ff-5070-037a-0adc-a3e7385cfefe">LRN</title>
<p id="_9f279874-248b-5db2-300b-bd5a2a3459f5">Local Response Normalization proposed in the <link target="https://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf">AlexNet paper</link>. It normalizes over local input regions. The local region is defined across the channels. For an element  <tt>X[n, c, d1, ..., dk]</tt> in a tensor of shape  <tt>(N x C x D1 x D2, ..., Dk)</tt>, its region is <tt>{X[n, i, d1, ..., dk] | max(0, c - floor((size - 1) / 2)) &lt;= i &lt;= min(C - 1, c + ceil((size - 1) / 2))}</tt>.</p>

<p id="_02bf7a58-267a-b1d0-9ff9-78f509d202d0"><tt>square_sum[n, c, d1, ..., dk] = sum(X[n, i, d1, ..., dk] ^ 2)</tt>, where  <tt>max(0, c - floor((size - 1) / 2)) &lt;= i &lt;= min(C - 1, c + ceil((size - 1) / 2))</tt>.</p>

<p id="_c127857a-464f-1bbe-d178-f996528917bc"><tt>Y[n, c, d1, ..., dk] = X[n, c, d1, ..., dk] / (bias + alpha / size * square_sum[n, c, d1, ..., dk] ) ^ beta</tt></p>

<dl id="_52e562ed-4750-cdb2-2514-346cdfebd68f"><dt>Domain</dt>
<dd id="_b1ee9b4c-28d7-9298-3cd6-f4195fcfc203"><p id="_f194dda8-5605-0668-0c28-6755efc1b9dd"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_7e799578-7a01-4262-1e60-31a3ebe1d3f8"><p id="_5e8aa01d-a0b2-aef3-14b3-9492164b15df">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_2aab47e8-5890-9d41-a5ef-8f32137e53b3"><p id="_1f6512ae-3d38-0a96-b5a3-7396808daad6">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_a335a585-198c-5db5-6eee-9cb13d668271"><p id="_4dce3ae8-f6e2-01be-7c8d-d1efe41628d2"><tt>X (differentiable) : T</tt> — Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 …​ Dn), where N is the batch size. Optionally, if dimension denotation is in effect, the operation expects the input data tensor to arrive with the dimension denotation of [DATA_BATCH, DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE …​].</p>
</dd>
<dt>Outputs</dt>
<dd id="_3a7d3ce5-c32c-8dda-5c35-8739c6b49e11"><p id="_ff4ece7d-4280-4cc1-352d-2a02a60594f8"><tt>Y (differentiable) : T</tt> — Output tensor, which has the shape and type as input tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_18f403b7-78b1-28f4-a3f0-b0fc633ca9d2"><p id="_174f4149-b4e1-046b-604a-7c28e5f15c14"><tt>alpha : float (default is 0.0001)</tt> — Scaling parameter.<br/> <tt>beta : float (default is 0.75)</tt> — The exponent.<br/> <tt>bias : float (default is 1.0)</tt><br/> <tt>size : int (required)</tt> — The number of channels to sum over</p>
</dd>
<dt>Type constraints</dt>
<dd id="_d0fe3ab8-dddf-7b6e-d7e3-bcf37d41f62c"><p id="_ef1f058d-71c6-fe47-1cf6-c3513db1b69a"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_e700ed75-8cf8-918c-b3be-ac135f57d891"><p id="_7763f6e9-38e2-64ac-5efe-a5ad059aa0f7"><tt>test_lrn_default</tt>, <tt>test_lrn</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_237f7e69-14eb-f651-119d-859c5386e0fc"><p id="_24675e20-db71-a99d-ce75-686e996a9c21">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_c9d0ed86-a8c2-bd48-da06-822feba36f0c" anchor="op-ai-onnx-default-lstm" obligation="normative">
<title id="_a18f2427-8f58-77eb-7615-ccdc93f2ecf5">LSTM</title>
<p id="_34bbbf39-7cf1-723d-28fd-676698e5bb12">Computes an one-layer LSTM. This operator is usually supported via some custom implementation such as CuDNN.</p>

<p id="_07a18f5b-ae16-a0ad-734e-5f4c1fa933ff">Notations:</p>

<ul id="_20183db2-9b40-e2fd-05ed-bfc033258258"><li><p id="_d07af5ad-afc0-4673-b000-c7a01aa92fac"><tt>X</tt> — input tensor</p>
</li>
<li><p id="_a8057f08-9635-3b48-4ef5-259614f14f88"><tt>i</tt> — input gate</p>
</li>
<li><p id="_87a3d399-8b14-8ad7-5c06-e3d0fc4e0c79"><tt>o</tt> — output gate</p>
</li>
<li><p id="_8275e6b7-c90a-842f-ae8c-8660140ad5e5"><tt>f</tt> — forget gate</p>
</li>
<li><p id="_2fff15d9-abc9-9c56-5101-d07ada991624"><tt>c</tt> — cell gate</p>
</li>
<li><p id="_deaaa3c2-5d89-f476-6c3b-9250d6ff290c"><tt>t</tt> — time step (t-1 means previous time step)</p>
</li>
<li><p id="_da9ddc56-a6ab-956f-fe21-aef3558cf529"><tt>W[iofc]</tt> — W parameter weight matrix for input, output, forget, and cell gates</p>
</li>
<li><p id="_bd92272d-c9e1-ffb7-e6e7-63d65b567250"><tt>R[iofc]</tt> — R recurrence weight matrix for input, output, forget, and cell gates</p>
</li>
<li><p id="_141f7883-b88e-6c18-06be-c1dbd522bae2"><tt>Wb[iofc]</tt> — W bias vectors for input, output, forget, and cell gates</p>
</li>
<li><p id="_059330ff-6f1c-5a6e-450a-c5b866e9b1a7"><tt>Rb[iofc]</tt> — R bias vectors for input, output, forget, and cell gates</p>
</li>
<li><p id="_8635d4e3-499e-d8ac-c3d9-1c557130c89e"><tt>P[iof]</tt>  — P peephole weight vector for input, output, and forget gates</p>
</li>
<li><p id="_d28701b4-1714-e3c5-9cc8-ba865f752209"><tt>WB[iofc]</tt> — W parameter weight matrix for backward input, output, forget, and cell gates</p>
</li>
<li><p id="_bff3f3c3-c1bc-a0ad-af10-cd97f96e217f"><tt>RB[iofc]</tt> — R recurrence weight matrix for backward input, output, forget, and cell gates</p>
</li>
<li><p id="_be21b85b-752e-b537-ea9d-425d4936dd4f"><tt>WBb[iofc]</tt> — W bias vectors for backward input, output, forget, and cell gates</p>
</li>
<li><p id="_024d2b91-070a-5c88-9b20-20ba8a5002e1"><tt>RBb[iofc]</tt> — R bias vectors for backward input, output, forget, and cell gates</p>
</li>
<li><p id="_2b22493c-cddf-e29c-9146-c564990c241e"><tt>PB[iof]</tt>  — P peephole weight vector for backward input, output, and forget gates</p>
</li>
<li><p id="_8ab19cc0-a261-7e48-196f-ec917a520f20"><tt>H</tt> — Hidden state</p>
</li>
<li><p id="_0753b332-f85b-ec65-3f7f-19f7361ea279"><tt>num_directions</tt> — 2 if direction == bidirectional else 1</p>
</li>
</ul>

<p id="_469568e6-f28d-05d9-d470-4d66c6d956b7">Activation functions:</p>

<ul id="_3ae8755e-ca8f-ccda-2c3d-69f9d0c5ef1f"><li><p id="_38e1c7b5-cefa-f052-b659-4488a3fd213c">Relu(x)                — max(0, x)</p>
</li>
<li><p id="_8cb7c629-9a56-44eb-9b3f-ceee04c670bc">Tanh(x)                — (1 — e^{-2x})/(1 + e^{-2x})</p>
</li>
<li><p id="_ff5dc362-65a0-44a5-2b27-fbf15a42242c">Sigmoid(x)             — 1/(1 + e^{-x})</p>
</li>
<note id="_0e42383c-8a66-3200-2ab2-37bd7b388244"><p id="_4d8c18ee-45eb-b0db-88a9-4c819b216945">Below are optional</p>
</note></ul>



<ul id="_70a127ea-91fe-3405-ab9e-89a0f7d494d3"><li><p id="_eba35501-9b25-28fb-5152-391aa191aa34">Affine(x)              — alpha*x + beta</p>
</li>
<li><p id="_f476eee3-eb93-a546-d456-ca05e1447400">LeakyRelu(x)           — x if x &gt;= 0 else alpha * x</p>
</li>
<li><p id="_107dbe6e-b971-84c6-6ba6-0d36379b8120">ThresholdedRelu(x)     — x if x &gt;= alpha else 0</p>
</li>
<li><p id="_cb9f2832-e687-361d-8b44-92c6eaf35126">ScaledTanh(x)          — alpha<em>Tanh(beta</em>x)</p>
</li>
<li><p id="_3ce07635-045d-8521-ff39-ae54bd59e38d">HardSigmoid(x)         — min(max(alpha*x + beta, 0), 1)</p>
</li>
<li><p id="_0c3e9cc7-131b-2499-5e05-e2611de39880">Elu(x)                 — x if x &gt;= 0 else alpha*(e^x — 1)</p>
</li>
<li><table id="_f03f6041-6ee5-176e-ce12-da6d64ef4e3e">
<name id="_b93d520d-205a-e8a0-1e7c-dbe152f2572c">Table from the upstream description of <tt>LSTM</tt></name>
<tbody><tr id="_1b6becec-d612-8499-0f14-59caf6904178"><td id="_dd36fe80-a8c7-13fb-879d-93f8aa3a972f" valign="top" align="left">Softsign(x)            — x/(1<br/></td>
<td id="_8068f75a-3c6a-8783-6587-cd90432661fe" valign="top" align="left">x</td>
<td id="_cfca449c-2b72-fa9f-5517-fbd3d26932da" valign="top" align="left">)</td>
</tr></tbody>
</table>
</li>
<li><p id="_e7f87024-0541-98e9-ae70-d3f13cd9b77d">Softplus(x)            — log(1 + e^x)</p>
</li>
</ul>

<p id="_3cec5cde-431c-f998-2948-19d3236b745c">Equations (Default: f=Sigmoid, g=Tanh, h=Tanh):</p>

<ul id="_933e4805-b8f2-8f13-a143-5deab7eac846"><li><p id="_aca6b9e6-fcd8-c9a0-34b9-c028c23ee206">it = f(Xt<em>(Wi^T) + Ht-1</em>(Ri^T) + Pi (.) Ct-1 + Wbi + Rbi)</p>
</li>
<li><p id="_f894f64b-b0b7-38cb-2a0d-df98fbf8149d">ft = f(Xt<em>(Wf^T) + Ht-1</em>(Rf^T) + Pf (.) Ct-1 + Wbf + Rbf)</p>
</li>
<li><p id="_25a38c39-c4bc-8805-a1f1-aefb5e92617c">ct = g(Xt<em>(Wc^T) + Ht-1</em>(Rc^T) + Wbc + Rbc)</p>
</li>
<li><p id="_79924a58-af49-2761-94ff-3ab585792890">Ct = ft (.) Ct-1 + it (.) ct</p>
</li>
<li><p id="_258e37e7-6b62-9fd5-9b76-e3638515ee47">ot = f(Xt<em>(Wo^T) + Ht-1</em>(Ro^T) + Po (.) Ct + Wbo + Rbo)</p>
</li>
<li><p id="_7da25f2f-4317-9f7a-4bb1-c5abbae5973b">Ht = ot (.) h(Ct) This operator has  <strong>optional</strong> inputs/outputs. See the doc for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument’s name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.</p>
<dl id="_f1abb3f8-9d56-be59-a4f5-7c20d3558c91"><dt>Domain</dt>
<dd id="_d9e1db56-302f-0bdd-f7c2-c09bd2707878"><p id="_3b7b6abc-8832-f771-d5c4-7b257ad7b0b3"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_40c77ba4-7e3d-6fdf-d057-b688d04ced77"><p id="_9e96d2a8-d12b-e81c-dfb7-93fd6ff492b3">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_7d6f2345-225d-1312-3d4f-f4a455ec2aa6"><p id="_62b07fc8-b6cb-17cd-c812-766e1aa112a1">1, 7, 14</p>
</dd>
<dt>Inputs (3 — 8)</dt>
<dd id="_69f038d2-cfad-fde6-d9cf-bd33dc80edf5"><p id="_04a2d1fe-4e85-2c4a-3dff-b92bddf36689"><tt>X (differentiable) : T</tt> — The input sequences packed (and potentially padded) into one 3-D tensor with the shape of <tt>[seq_length, batch_size, input_size]</tt>.<br/> <tt>W (differentiable) : T</tt> — The weight tensor for the gates. Concatenation of <tt>W[iofc]</tt> and <tt>WB[iofc]</tt> (if bidirectional) along dimension 0. The tensor has shape <tt>[num_directions, 4*hidden_size, input_size]</tt>.<br/> <tt>R (differentiable) : T</tt> — The recurrence weight tensor. Concatenation of <tt>R[iofc]</tt> and <tt>RB[iofc]</tt> (if bidirectional) along dimension 0. This tensor has shape <tt>[num_directions, 4*hidden_size, hidden_size]</tt>.<br/> <tt>B (optional, differentiable) : T</tt> — The bias tensor for input gate. Concatenation of <tt>[Wb[iofc], Rb[iofc]]</tt>, and <tt>[WBb[iofc], RBb[iofc]]</tt> (if bidirectional) along dimension 0. This tensor has shape <tt>[num_directions, 8*hidden_size]</tt>. Optional: If not specified — assumed to be 0.<br/> <tt>sequence_lens (optional, non-differentiable) : T1</tt> — Optional tensor specifying lengths of the sequences in a batch. If not specified — assumed all sequences in the batch to have length <tt>seq_length</tt>. It has shape <tt>[batch_size]</tt>.<br/> <tt>initial_h (optional, non-differentiable) : T</tt> — Optional initial value of the hidden. If not specified — assumed to be 0. It has shape <tt>[num_directions, batch_size, hidden_size]</tt>.<br/> <tt>initial_c (optional, non-differentiable) : T</tt> — Optional initial value of the cell. If not specified — assumed to be 0. It has shape <tt>[num_directions, batch_size, hidden_size]</tt>.<br/> <tt>P (optional, differentiable) : T</tt> — The weight tensor for peepholes. Concatenation of <tt>P[iof]</tt> and <tt>PB[iof]</tt> (if bidirectional) along dimension 0. It has shape <tt>[num_directions, 3*hidden_size]</tt>. Optional: If not specified — assumed to be 0.</p>
</dd>
<dt>Outputs (0 — 3)</dt>
<dd id="_0fb0df1a-6a67-359f-9354-b92ed9e8dedc"><p id="_f72a0d30-ecc8-fb5e-ace5-815eccb6ce9e"><tt>Y (optional, differentiable) : T</tt> — A tensor that concats all the intermediate output values of the hidden. It has shape <tt>[seq_length, num_directions, batch_size, hidden_size]</tt>.<br/> <tt>Y_h (optional, differentiable) : T</tt> — The last output value of the hidden. It has shape <tt>[num_directions, batch_size, hidden_size]</tt>.<br/> <tt>Y_c (optional, differentiable) : T</tt> — The last output value of the cell. It has shape <tt>[num_directions, batch_size, hidden_size]</tt>.</p>
</dd>
<dt>Attributes</dt>
<dd id="_a1677085-1933-3a32-cf8c-a6b20b2b94aa"><p id="_de6c152e-2449-a7f8-0ad4-501b2e345fc1"><tt>activation_alpha : list of floats</tt> — Optional scaling values used by some activation functions. The values are consumed in the order of activation functions, for example (f, g, h) in LSTM. Default values are the same as of corresponding ONNX operators.For example with LeakyRelu, the default alpha is 0.01.<br/> <tt>activation_beta : list of floats</tt> — Optional scaling values used by some activation functions. The values are consumed in the order of activation functions, for example (f, g, h) in LSTM. Default values are the same as of corresponding ONNX operators.<br/> <tt>activations : list of strings</tt> — A list of 3 (or 6 if bidirectional) activation functions for input, output, forget, cell, and hidden. The activation functions must be one of the activation functions specified above. Optional: See the equations for default if not specified.<br/> <tt>clip : float</tt> — Cell clip threshold. Clipping bounds the elements of a tensor in the range of [-threshold, +threshold] and is applied to the input of activations. No clip if not specified.<br/> <tt>direction : string (default is forward)</tt> — Specify if the RNN is forward, reverse, or bidirectional. Must be one of forward (default), reverse, or bidirectional.<br/> <tt>hidden_size : int</tt> — Number of neurons in the hidden layer<br/> <tt>input_forget : int (default is 0)</tt> — Couple the input and forget gates if 1.<br/> <tt>layout : int (default is 0)</tt> — The shape format of inputs X, initial_h, initial_c and outputs Y, Y_h, Y_c. If 0, the following shapes are expected: X.shape = [seq_length, batch_size, input_size], Y.shape = [seq_length, num_directions, batch_size, hidden_size], initial_h.shape = Y_h.shape = initial_c.shape = Y_c.shape = [num_directions, batch_size, hidden_size]. If 1, the following shapes are expected: X.shape = [batch_size, seq_length, input_size], Y.shape = [batch_size, seq_length, num_directions, hidden_size], initial_h.shape = Y_h.shape = initial_c.shape = Y_c.shape = [batch_size, num_directions, hidden_size].</p>
</dd>
<dt>Type constraints</dt>
<dd id="_1854699d-87ca-f4d8-6d82-173c12bb6b8f"><p id="_934d43e2-16c2-b11f-3a64-23568f69a013"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.<br/> <tt>T1 : tensor(int32)</tt> — Constrain seq_lens to integer tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_d6fff5e6-38f9-7ecc-8f7c-95d1dce9f93d"><p id="_f380961b-fbf8-3185-b610-889ff3e8bd31"><tt>test_lstm_batchwise</tt>, <tt>test_lstm_bidirectional</tt>, <tt>test_lstm_defaults</tt>, <tt>test_lstm_with_initial_bias</tt>, <tt>test_lstm_with_peepholes</tt>, <tt>test_lstm_reverse</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_7e5a0e1a-50c9-a4b5-cd81-536a6994c21a"><p id="_cb5dc91c-f137-da39-42b4-9566829e5cb9">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</li>
</ul>
</clause>

<clause id="_61ab0bc3-900e-8dd2-d398-c98faa9cf66d" anchor="op-ai-onnx-default-layernormalization" obligation="normative">
<title id="_14eedfcf-ffd6-5a15-068b-345f548f5187">LayerNormalization</title>
<p id="_768215da-7b5b-4cc3-d66f-d632b253bb50">This is layer normalization defined in ONNX as function.       The overall computation can be split into two stages.       The first stage is standardization, which makes the       normalized elements have zero mean and unit variances.       The computation required by standardization can be       described by the following equations.       `       Mean =  <tt>ReduceMean&lt;axes=normalized_axes&gt;</tt>(X)       D = Sub(X, Mean)       DD = Mul(D, D)       Var =  <tt>ReduceMean&lt;axes=normalized_axes&gt;</tt>(DD)       VarEps = Add(Var, epsilon)       StdDev = Sqrt(VarEps)       InvStdDev = Reciprocal(StdDev)       Normalized = Mul(D, InvStdDev)      `       where  <tt>normalized_axes</tt> is <tt>[axis, ..., rank of X - 1]</tt>.       The variables  <tt>Var</tt> and <tt>StdDev</tt> stand for variance and       standard deviation, respectively. The second output is        <tt>Mean</tt> and the last one is <tt>InvStdDev</tt>.       Depending on  <tt>stash_type</tt> attribute, the actual computation       must happen in different floating-point precision.       For example, if  <tt>stash_type</tt> is 1, this operator casts       all input variables to 32-bit float, perform the computation, and       finally cast  <tt>Normalized</tt> back to the original type of <tt>X</tt>.       The second stage then scales and shifts the outcome of the       first stage using       `       NormalizedScaled = Mul(Normalized, Scale)       Y = Add(NormalizedScaled, B)      `       The second stage doesn’t depends on  <tt>stash_type</tt>.       All equations are in  <link target="https://github.com/onnx/onnx/blob/main/docs/Syntax.md">this syntax</link>.       The same variable (i.e., input, output, and attribute) uses       the same name in the equations above and this operator’s definition.       Let  <tt>d[i]</tt> indicate the i-th dimension of <tt>X</tt>.       If  <tt>X</tt>‘s shape is <tt>[d[0], ..., d[axis-1], d[axis], ..., d[rank-1]]</tt>,       the shape of  <tt>Mean</tt> and <tt>InvStdDev</tt> is <tt>[d[0], ..., d[axis-1], 1, ..., 1]</tt>.        <tt>Y</tt> and <tt>X</tt> have the same shape. This operator supports unidirectional broadcasting       (tensors  <tt>Scale</tt> and <tt>B</tt> should be unidirectional broadcastable to tensor <tt>X</tt>);       for more details please check the doc.</p>

<dl id="_8a7292fc-d894-dd5d-e5fa-e7512b30e668"><dt>Domain</dt>
<dd id="_c0a042ef-dc86-22fc-f0d7-54b294a4bd0c"><p id="_673a750d-b5b2-911e-2936-19fb56398c45"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_338f81af-6df8-ac7a-4374-25d9d75018ab"><p id="_97be5086-0c09-56fc-968a-e9d06ad0687b">17</p>
</dd>
<dt>Inputs (2 — 3)</dt>
<dd id="_801d8e8c-5a6a-6023-e0f2-0ebd494fcd13"><p id="_e1e8d6d9-17a5-24b3-3874-4eebae494d8e"><tt>X : T</tt> — Tensor to be normalized.<br/> <tt>Scale : T</tt> — Scale tensor.<br/> <tt>B (optional) : T</tt> — Bias tensor.</p>
</dd>
<dt>Outputs (1 — 3)</dt>
<dd id="_0000b9b0-2769-e7d8-e107-9af301fb4423"><p id="_077c7580-b3f5-9473-5258-46afffd9573b"><tt>Y : T</tt> — Normalized tensor.<br/> <tt>Mean (optional) : U</tt> — Saved mean used during training to speed up gradient computation<br/> <tt>InvStdDev (optional) : U</tt> — Saved inverse standard deviation used during training to speed up gradient computation.</p>
</dd>
<dt>Attributes</dt>
<dd id="_b6cbe816-829a-a918-b950-2d05dbbebf32"><p id="_76b3cc71-9dbe-9848-bdcd-bf2b06ef9b33"><tt>axis : int (default is -1)</tt> — The first normalization dimension. If rank(X) is r, axis’ allowed range is [-r, r). Negative value means counting dimensions from the back.<br/> <tt>epsilon : float (default is 1e-05)</tt> — The epsilon value to use to avoid division by zero.<br/> <tt>stash_type : int (default is 1)</tt> — Type of Mean and InvStdDev. This also specifies stage one’s computation precision.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_095f46dd-dd82-c83d-9353-60c4b6509d2e"><p id="_ac0ea463-8bd5-989c-8584-30aaccfde438"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input types and output Y type to float tensors.<br/> <tt>U : tensor(float), tensor(bfloat16)</tt> — Type of Mean and InvStdDev tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_79640ac1-d82a-14bc-f837-edb6ccfd9e21"><p id="_6478fceb-1c9e-9302-1174-6bd187bc6e73"><tt>test_layer_normalization_default_axis</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_e8e4009a-7f4a-8d56-78fe-731f56592411"><p id="_dee52efd-b339-5ddb-5d4f-e46d39543792">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_1f5fd93b-a4a2-3f62-bc0f-f9e68a870d77" anchor="op-ai-onnx-default-leakyrelu" obligation="normative">
<title id="_e3ca5d9e-d68b-cd54-6904-6f5f54409778">LeakyRelu</title>
<p id="_63fee675-8016-be64-411c-125d757a13a1">LeakyRelu takes input data (<tt>Tensor&lt;T&gt;</tt>) and an argument alpha, and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the function <tt>f(x) = alpha * x for x &lt; 0</tt>, <tt>f(x) = x for x &gt;= 0</tt>, is applied to the data tensor elementwise.</p>

<dl id="_a01b465c-86b3-c8d6-25d9-1afeff9f4d91"><dt>Domain</dt>
<dd id="_d0ddb80a-081c-bdb9-b832-f2cc164c5d46"><p id="_00c7cbc9-57e9-1080-edcd-bf0f84561bab"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_b49f5bec-4519-ee6a-73dd-40b4345959ed"><p id="_6d49b056-d2b1-4eb1-4261-c56733de5117">16</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_3d38a601-d653-a347-0a54-019b39451a05"><p id="_a1932e32-e471-ddba-80f2-d7a64bdf2859">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_6004e479-7493-ac1d-7b39-db3a63fd4dd3"><p id="_d563780d-3716-1727-227c-efefbc65ec8d"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_9ec668ca-aac1-dd46-5d89-2fba8d411195"><p id="_faf2d798-c35d-3a31-f3db-9678e098a2b0"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_0b25c642-7dfc-e5d0-a5bd-e208800d4626"><p id="_c41ab89a-eac7-5c00-a8a1-ba9bf0d3e39e"><tt>alpha : float (default is 0.01)</tt> — Coefficient of leakage.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_1ec8e7de-2ee6-27b2-98cd-71e8de93f274"><p id="_640032f5-6e1f-21a9-61c6-56352d51c1c5"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_fd49ac49-5139-351c-21c4-dd4c5e02acfa"><p id="_1296b59a-49dc-3026-8127-83d00d355849"><tt>test_leakyrelu_example</tt>, <tt>test_leakyrelu</tt>, <tt>test_leakyrelu_default</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_bb67c5ed-3ee5-b90a-095d-7bd3f247783c"><p id="_9d1d237a-55a0-3099-460d-3cfbc8891774">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_1ad52751-d1c9-5ed2-79eb-2c6aa26f2b0d" anchor="op-ai-onnx-default-less" obligation="normative">
<title id="_98328529-c9f7-c6a0-d54f-ed2ed9eac048">Less</title>
<p id="_b58f5275-d800-8153-4234-dff9703a7b3e">Returns the tensor resulted from performing the <tt>less</tt> logical operation elementwise on the input tensors  <tt>A</tt> and <tt>B</tt> (with Numpy-style broadcasting support).</p>

<p id="_0c749183-a8a9-9e68-e7a1-a8f383cac068">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_9bc24ecb-ab7e-9d73-b9dc-2d22046e9a27"><dt>Domain</dt>
<dd id="_eac8a16f-aefb-e727-4f7f-f2624d54d03c"><p id="_0a0105bb-e137-5e26-cd71-63562e6bc10a"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_448d838b-695f-2119-0faf-2eb11914d4c9"><p id="_f218d4e3-d2f6-853b-6572-576e86fdcb10">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_a9d8da60-4220-38fb-c982-47190fe2041c"><p id="_e3620521-092c-5a90-5fb2-58a70545a867">1, 7, 9</p>
</dd>
<dt>Inputs</dt>
<dd id="_c56cc566-2e69-4d46-9544-0aa3062ef86c"><p id="_eee619d0-f6de-aa90-9af4-364b78737a5d"><tt>A (non-differentiable) : T</tt> — First input operand for the logical operator.<br/> <tt>B (non-differentiable) : T</tt> — Second input operand for the logical operator.</p>
</dd>
<dt>Outputs</dt>
<dd id="_21ae7bc4-a38a-5c9e-d04c-5e5de7b8617d"><p id="_623fc6b2-9aee-b3cd-52fc-2c0413ecef3f"><tt>C (non-differentiable) : T1</tt> — Result tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_99a7ec2f-5170-872f-770f-7a1b81a0b572"><p id="_1c5d979d-8360-976d-a83f-ffc7138e154e">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_d785a510-dbb3-1db8-2778-514a425bc293"><p id="_071692d9-0510-6d78-a3a7-1219f641ad1c"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input types to all numeric tensors.<br/> <tt>T1 : tensor(bool)</tt> — Constrain output to boolean tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_0bf1f4ae-b8d0-cb34-1c35-76e1cccca512"><p id="_16b1bd57-e6d1-49e7-0297-0abbb35a932c"><tt>test_less</tt>, <tt>test_less_int8</tt>, <tt>test_less_int16</tt>, <tt>test_less_uint8</tt>, <tt>test_less_uint16</tt>, <tt>test_less_uint32</tt>, <tt>test_less_uint64</tt>, <tt>test_less_bcast</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_2250cd79-c0a7-0c2e-12b2-5416d4fee33f"><p id="_80f9e1a9-ad96-e0a0-4f8a-c8c410411d14">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_d3826ef7-085f-ebff-2ffb-6a50dfcca293" anchor="op-ai-onnx-default-lessorequal" obligation="normative">
<title id="_0dae75dd-1a76-6ecb-c0e4-284d15397186">LessOrEqual</title>
<p id="_128cc988-6ee4-4c4e-a850-d61a8f73ac90">Returns the tensor resulted from performing the <tt>less_equal</tt> logical operation elementwise on the input tensors  <tt>A</tt> and <tt>B</tt> (with Numpy-style broadcasting support).</p>

<p id="_fd71dc1d-b640-f666-07b5-58572dd1a1f4">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_5599942b-1566-61da-3f63-30e2e75b1933"><dt>Domain</dt>
<dd id="_8ee7dfd3-47a6-6215-43bc-3ebdf6648c09"><p id="_1da2090e-9a91-86f8-43d7-1150efdc7753"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_ddb66f33-3eaf-d884-5893-a832ca3bdf4d"><p id="_38dc6f79-854c-3b1c-44a7-3a2882e3224d">16</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_5ae2da37-a097-0a40-b614-844143852fea"><p id="_d2d2ab01-7a22-9917-e568-63770d6b3421">12</p>
</dd>
<dt>Inputs</dt>
<dd id="_0bc5bc75-d5d3-3f5b-874d-81c29e1cc41b"><p id="_e7ce5da9-f3a6-531e-3534-bc9013cca90b"><tt>A (non-differentiable) : T</tt> — First input operand for the logical operator.<br/> <tt>B (non-differentiable) : T</tt> — Second input operand for the logical operator.</p>
</dd>
<dt>Outputs</dt>
<dd id="_3ad338d9-20a7-d1f4-39a7-29ce96cb2bb8"><p id="_95b8ff0b-6a41-94b4-75ee-146c22a4f322"><tt>C (non-differentiable) : T1</tt> — Result tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_6949eaaa-ae80-c959-ddf8-dfdc86bc7b26"><p id="_da8b8f10-ec8b-1934-fb96-bf751139fd38">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_227050bf-f1a9-a8a7-822e-c8a17775a297"><p id="_0526e7fa-734b-dc76-c57f-dfae7fe4309e"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input types to all numeric tensors.<br/> <tt>T1 : tensor(bool)</tt> — Constrain output to boolean tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_d6571047-39b2-313b-6200-2989ece53b20"><p id="_e763cf92-fd6a-4a56-18cf-98829f1f0768"><tt>test_less_equal_bcast</tt>, <tt>test_less_equal</tt>, <tt>test_less_equal_int8</tt>, <tt>test_less_equal_int16</tt>, <tt>test_less_equal_uint8</tt>, <tt>test_less_equal_uint16</tt>, <tt>test_less_equal_uint32</tt>, <tt>test_less_equal_uint64</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_256a3fcd-4304-34ac-36e4-729449655142"><p id="_4bff4bc0-6c3b-6dd0-c5e6-a93e873ac6a8">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_18f35e9e-ec65-30ae-8c2c-047aecb56c95" anchor="op-ai-onnx-default-linearattention" obligation="normative">
<title id="_7a4de5e4-c2bb-7ce3-965e-f327e9b12ac6">LinearAttention</title>
<p id="_93701974-fdc7-6a97-709f-d3773ae2daf6">Unified linear attention operator for autoregressive decoding (T=1) and prefill (T&gt;1).</p>

<p id="_d11c1cd9-299f-e83b-0aee-4147a3ba26bd">The query, key, value, and (where applicable) decay/beta inputs use 3D packed format [B, T, H*D], where heads are flattened into the last dimension; q_num_heads and kv_num_heads are always required and are used to unpack to 4D internally for computation. The optional past_state and present_state are 4D with shape (B, H_kv, d_k, d_v).</p>

<p id="_f273ba7d-64d4-d334-7059-805cffbbb69d">Group-query attention (GQA) is supported: q_num_heads must be a positive multiple of kv_num_heads. When q_num_heads == kv_num_heads this reduces to multi-headed linear attention; when q_num_heads &gt; kv_num_heads each KV head (and its recurrent state) is shared by  <tt>q_num_heads / kv_num_heads</tt> query heads (multi-query attention is the special case kv_num_heads == 1).</p>

<p id="_4db5db8e-1de4-b495-c696-d5bb24ca8dfa">The update_rule attribute selects the recurrence type:</p>

<ul id="_1f9e9cd5-53f3-489d-1597-b58eae274348"><li><p id="_376085c4-1fa7-64a0-fa6a-6cb328ce15ea">“linear”: S_t = S_{t-1} + k_t ⊗ v_t; o_t = scale * q_t^T S_t</p>
</li>
<li><p id="_260f9bb4-0007-5036-8ec3-e0421ee00807">“gated”: S_t = exp(g_t) * S_{t-1} + k_t ⊗ v_t; o_t = scale * q_t^T S_t</p>
</li>
<li><p id="_d68ce54e-4b1f-14a9-d711-3db911de3e8c">“delta”: S_t = S_{t-1} + β_t * k_t ⊗ (v_t — S_{t-1}^T k_t); o_t = scale * q_t^T S_t</p>
</li>
<li><p id="_c302d7cc-ae2f-1838-723a-f6ba6d29fe6b">“gated_delta”: S_t = exp(g_t) * S_{t-1} + β_t * k_t ⊗ (v_t — exp(g_t) * S_{t-1}^T k_t); o_t = scale * q_t^T S_t</p>
</li>
</ul>

<p id="_ed731189-af89-bc76-4a2b-fd3dc1ddf28b">where g_t is the decay (in log-space), β_t is the update rate, and ⊗ denotes outer product.</p>

<p id="_296aa4ee-8aea-f74e-09b8-caf0d7e2705d">Semantics: Equivalent to running the recurrent update sequentially for each token, but may be implemented using chunk-parallel algorithms for GPU efficiency.</p>

<dl id="_b3e15f44-5af8-1908-4f12-a83344fa92b2"><dt>Domain</dt>
<dd id="_ab01505f-4eb6-b8a3-856d-85cb18024b28"><p id="_a2ddb6a6-b231-d752-f6aa-ff63d2b4ead3"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_ea7ab265-096c-45f0-e0c2-af062a5076d5"><p id="_8775c94c-476d-b04c-44e6-4407eee53b26">27</p>
</dd>
<dt>Inputs (3 — 6)</dt>
<dd id="_266373e6-11f7-e23a-508a-64b8cb5d01fd"><p id="_4f45e216-0894-d882-8591-d88da3ef63b5"><tt>query (differentiable) : T</tt> — Query vectors with 3D packed shape (B, T, H_q * d_k). Heads are packed into the last dimension.<br/> <tt>key (differentiable) : T</tt> — Key vectors with 3D packed shape (B, T, H_kv * d_k). Should be L2-normalized for delta/gated_delta modes.<br/> <tt>value (differentiable) : T</tt> — Value vectors with 3D packed shape (B, T, H_kv * d_v).<br/> <tt>past_state (optional, non-differentiable) : S</tt> — Recurrent state from previous step with shape (B, H_kv, d_k, d_v). Always 4D. If not provided, defaults to zeros.<br/> <tt>decay (optional, differentiable) : T</tt> — Exponential decay gate in log-space. 3D packed shape: (B, T, H_kv * d_k) for per-key-dimension decay (GLA/RWKV-6), or (B, T, H_kv) for per-head scalar decay (DeltaNet/RetNet). Required for ‘gated’ and ‘gated_delta’ modes.<br/> <tt>beta (optional, differentiable) : T</tt> — Update rate (sigmoid output). 3D packed shape: (B, T, H_kv) or (B, T, 1). Required for ‘delta’ and ‘gated_delta’ modes.</p>
</dd>
<dt>Outputs</dt>
<dd id="_b4083ab8-24b7-e995-a58a-1ba8f914dad5"><p id="_f2a1e1a4-2d9b-81eb-7244-a9ddcee3eb06"><tt>output (differentiable) : T</tt> — Attention output with 3D packed shape (B, T, H_q * d_v).<br/> <tt>present_state (non-differentiable) : S</tt> — Updated recurrent state with shape (B, H_kv, d_k, d_v). Always 4D.</p>
</dd>
<dt>Attributes</dt>
<dd id="_4be15456-9e14-cc98-d70c-4e5cfe28e5be"><p id="_6059e413-8d0c-209a-dd3b-304b86af2261"><tt>chunk_size : int (default is 64)</tt> — Chunk size for the chunk-parallel WY decomposition during prefill (T&gt;1). Tuning hint; does not affect output correctness.<br/> <tt>kv_num_heads : int (required)</tt> — Number of key/value heads. Always required.<br/> <tt>q_num_heads : int (required)</tt> — Number of query heads. Always required.<br/> <tt>scale : float (default is 0.0)</tt> — Output scaling factor. When 0.0 (default), derives d_k = query.shape[-1] / q_num_heads and uses 1/sqrt(d_k). Set explicitly to override.<br/> <tt>update_rule : string (default is gated_delta)</tt> — The update rule for the linear attention recurrence. One of: ‘linear’, ‘gated’, ‘delta’, ‘gated_delta’. Default is ‘gated_delta’.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_a57d612e-eac7-0bc3-f69d-3ef6f531d002"><p id="_a86f0ead-3462-b03d-809a-53b4632a0e53"><tt>T : tensor(float16), tensor(bfloat16), tensor(float)</tt> — Constrain activation input and output types to float16, bfloat16, or float32 tensors.<br/> <tt>S : tensor(float16), tensor(bfloat16), tensor(float)</tt> — Constrain state types to float16, bfloat16, or float32 tensors. Should be float32 or the same as T for numerical stability on long sequences.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_4fb0abc6-c642-0b5d-94c2-1d2ceb3bd78c"><p id="_8b27fb17-af9c-dda7-6125-a51687bfc3ec"><tt>test_linear_attention_decode_step</tt>, <tt>test_linear_attention_delta</tt>, <tt>test_linear_attention_explicit_scale</tt>, <tt>test_linear_attention_fp16</tt>, <tt>test_linear_attention_gated</tt>, <tt>test_linear_attention_gated_delta</tt>, <tt>test_linear_attention_gated_delta_beta_scalar</tt>, <tt>test_linear_attention_gated_delta_gqa</tt>, <tt>test_linear_attention_gated_delta_mqa</tt>, <tt>test_linear_attention_gated_per_head_decay</tt>, <tt>test_linear_attention_linear</tt>, <tt>test_linear_attention_linear_t1_no_past</tt>, <tt>test_linear_attention_no_past_explicit_zeros</tt>, <tt>test_linear_attention_prefill_with_past</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_b2be175f-1a99-22ee-be23-559b8ec6bada"><p id="_cc0f76c9-b4a9-f184-7eca-91864047f442">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_8230c354-c000-040b-6156-77ca943e7765" anchor="op-ai-onnx-default-log" obligation="normative">
<title id="_70c2df05-e92a-d6cb-ff3b-5a9857deed53">Log</title>
<p id="_a922298d-5fba-441c-33ba-25248e366884">Calculates the natural log of the given input tensor, element-wise.</p>

<dl id="_6d4db506-734c-4b86-1d5c-48320e575338"><dt>Domain</dt>
<dd id="_336ea63e-a24d-6895-742a-b10d2e38b030"><p id="_e5c7acf1-eec5-c0bb-4b13-3f4b169e8f19"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_6f327334-eeeb-8969-5b2c-81a890878489"><p id="_ed433c9b-34fb-a7a2-9615-8e4bc93cbb74">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_0dee24e9-df1d-9960-324d-b8b40659ec57"><p id="_bb520450-fc0f-be86-0d71-3cca1ca9ac52">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_71a40bf2-f518-a95a-8e2b-17e93c166c08"><p id="_c0b63c16-0502-8c7b-e51a-c49c6cec0828"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_83121e8c-6caa-726e-39c0-934fc6661a01"><p id="_52372338-9752-6e8f-e71d-3e3a6e861ca2"><tt>output (differentiable) : T</tt> — The natural log of the input tensor computed element-wise</p>
</dd>
<dt>Attributes</dt>
<dd id="_86d5ec69-f805-aff3-6eab-f6b4234e3cb9"><p id="_541bfa4f-f520-2d35-5b45-32363778b3ed">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_2ae92328-ce34-1a87-ce01-d0e7ed34c981"><p id="_8d91e193-77d9-e886-fcd2-647cd079a9d8"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_226c54dc-7d15-7f82-f2a5-3baf9ead5722"><p id="_8d89a1b7-391f-4913-c11b-b1ca8873eb43"><tt>test_log_example</tt>, <tt>test_log</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_79486c0b-4735-8483-48b7-ecfd12411697"><p id="_a2f7600f-ae7b-5a90-c90e-44e6ebcbb1ec">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_d80a29bb-8304-b17a-127f-ccaf59688e60" anchor="op-ai-onnx-default-logsoftmax" obligation="normative">
<title id="_7449dd75-1b87-3de4-b238-05b5b113cabd">LogSoftmax</title>
<p id="_6bb5fd0c-f972-b3a6-00fe-5ed8eb9377d4">The operator computes the log of softmax values for the given input:</p>

<p id="_9740c615-3440-c135-f6ce-2cb8c93324d3">LogSoftmax(input, axis) = Log(Softmax(input, axis=axis))</p>

<p id="_983bcbc3-85f9-b2fb-c13b-b4f07493262b">The “axis” attribute indicates the dimension along which LogSoftmax will be performed. The output tensor has the same shape and contains the LogSoftmax values of the corresponding input.</p>

<dl id="_dea0fc65-4e4f-0434-a9a6-75dfd79ad43d"><dt>Domain</dt>
<dd id="_edfdb789-7c27-d4c6-cf69-f78ce04a7ef8"><p id="_2cbed5e8-657f-2664-fc9e-ad46d3d97a96"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_4b1110fc-cb53-f34c-3863-45ab42f459f8"><p id="_62fb73ce-dfd2-96ad-6735-2fc32338b9b8">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_5d4c5a9f-ba0b-7f6f-56ee-039b9fc39721"><p id="_c72fa0cc-3b5b-bddb-a9fd-d554358a5b8d">1, 11</p>
</dd>
<dt>Inputs</dt>
<dd id="_f483aebb-c71b-f4a3-833f-4ae7dc54acab"><p id="_a07692f3-285c-7c1c-f769-9f64d620f227"><tt>input (differentiable) : T</tt> — The input tensor of rank &gt;= axis.</p>
</dd>
<dt>Outputs</dt>
<dd id="_3f6a83ac-e83d-c42f-efa4-1bb3d5f75bf0"><p id="_94cea442-49d9-e49a-e7e3-0f85298641bf"><tt>output (differentiable) : T</tt> — The output values with the same shape as the input tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_901b7c8c-9a86-c4bb-01eb-7e176acf2c66"><p id="_2413a052-1098-e5d2-2c48-4a00c16e79ab"><tt>axis : int (default is -1)</tt> — Describes the dimension LogSoftmax will be performed on. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(input).</p>
</dd>
<dt>Type constraints</dt>
<dd id="_a8f45c48-50b9-c9ec-9017-995814e694e4"><p id="_63719594-cfb0-e467-2b83-d121dacc94eb"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_bc8a73bf-842e-e69a-cb04-9ce15502dae1"><p id="_5c117812-3b9e-e075-53b3-396eda3a09f9"><tt>test_logsoftmax_example_1</tt>, <tt>test_logsoftmax_large_number</tt>, <tt>test_logsoftmax_axis_0</tt>, <tt>test_logsoftmax_axis_1</tt>, <tt>test_logsoftmax_axis_2</tt>, <tt>test_logsoftmax_negative_axis</tt>, <tt>test_logsoftmax_default_axis</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_6a7c40d7-0db8-98fa-9c7f-dd82b4d14b90"><p id="_795b5676-375a-837c-17be-6ba5d4eed7af">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_341dc5f2-4bd7-bb99-ae02-3e1a9f471a98" anchor="op-ai-onnx-default-loop" obligation="normative">
<title id="_371ad717-e4db-f1ed-a3dc-9dae275c3aea">Loop</title>
<p id="_ed3758bc-d331-f299-3fbb-907d065826bc">Generic Looping construct. This loop has multiple termination conditions:</p>

<p id="_37b72c9b-f545-f3ad-aefd-98a50e4b83bd">1) Trip count. Iteration count specified at runtime. Set by    specifying the input M. Optional. Set to empty string to omit.    Note that a static trip count (specified at graph construction time) can be    specified by passing in a constant node for input M. 2) Loop termination condition. This is an input to the op that determines    whether to run the first iteration and also a loop-carried dependency for    the body graph. The body graph must yield a value for the condition variable,    whether this input is provided or not.</p>

<p id="_59f062f9-7a1a-69bc-489d-83acc845e70a">This table summarizes the operating modes of this operator with equivalent C-style code:</p>

<p id="_086129eb-724c-ac91-20a5-46e5053b540a">Operator inputs defined as (max_trip_count, condition_var).</p>

<ul id="_ded6707d-bb43-2002-c6bc-465c8a0b02e0"><li><p id="_8c23a659-c5c7-ebf1-0989-b7299cf57d3d">input (“”, “”): for (int i=0; ; ++i) {   cond = …​ // Note this value is ignored, but is required in the body }</p>
</li>
<li><p id="_e6a989a4-0cdd-340b-d4ab-447c9da0528d">input (“”, cond) // Note this is analogous to a while loop bool cond = …​; for (int i=0; cond; ++i) {   cond = …​; }</p>
</li>
<li><p id="_470d3d71-44f7-45e1-2cc0-f96d5b6db513">input (“”, 1) // Note this is analogous to a do-while loop bool cond = true for (int i=0; cond; ++i) {   cond = …​; }</p>
</li>
<li><p id="_c9a7715d-8cdd-93db-b48b-255388480d58">input (trip_count, “”) // Note this is analogous to a for loop int trip_count = …​ for (int i=0; i &lt; trip_count; ++i) {   cond = …​; // ignored }</p>
</li>
<li><p id="_741cd322-3bbc-bdd0-8ff8-047d752f8cb3">input (trip_count, cond) int trip_count = …​; bool cond = …​; for (int i=0; i &lt; trip_count &amp;&amp; cond; ++i) {   cond = …​; }</p>
</li>
</ul>

<p id="_bce1b86c-fcf1-6fa2-b98b-cd14802fee97"><em>Sample usage — cond as well as trip count</em></p>

<sourcecode id="_4f1278e9-25eb-ad91-e54f-f9fb2684aa38" unnumbered="true"><body>graph predict-net {
  %a = Constant[value = &lt;Scalar Tensor [3]&gt;]()
  %b = Constant[value = &lt;Scalar Tensor [6]&gt;]()
  %keepgoing = Constant[value = &lt;Scalar Tensor [1]&gt;]()
  %max_trip_count = Constant[value = &lt;Scalar Tensor [10]&gt;]()
  %keepgoing_out, %b_out, %user_defined_vals = Loopbody = &lt;graph body-net&gt;
  return
}

graph body-net (
  %i[INT32, scalar]           // iteration number
  %keepgoing_in[BOOL, scalar] // incoming loop-termination-condition; not used
  %b_in[INT32, scalar]        // incoming value of loop-carried-dependency b
) {
  %my_local = Add(%a, %b_in)
  %b_out = Sub(%a, %b_in) // outgoing value of loop-carried-dependency b
  %keepgoing_out = Greater(%my_local, %b_out) // outgoing loop-termination-condition
  %user_defined_val = Add(%b_in, %b_in) // scan-output value to be accumulated
  return %keepgoing_out, %b_out, %user_defined_val
}</body></sourcecode>


<p id="_8f9c6318-0cbf-30bd-31d8-cae9c5a60d1c"><em>Sample equivalent C code</em></p>

<sourcecode id="_6bcbc3be-71eb-9e3f-3cc1-e611aa3359b7" unnumbered="true"><body>{
  /* User-defined code (enclosing scope) */
  int a = 3, b = 6;
  bool keepgoing = true; // Analogous to input cond
  /* End user-defined code */

  /* Implicitly-defined code */
  const int max_trip_count = 10; // Analogous to input M
  int user_defined_vals[]; // Imagine this is resizable
  /* End implicitly-defined code */
  /* initialize loop-carried variables and scan-output variables */
  bool keepgoing_out = keepgoing
  int b_out = b

  for (int i=0; i &lt; max_trip_count &amp;&amp; keepgoing_out; ++i) {
    /* Implicitly-defined code: bind actual parameter values
       to formal parameter variables of loop-body */
    bool keepgoing_in = keepgoing_out;
    bool b_in = b_out;

    /* User-defined code (loop body) */
    int my_local = a + b_in; // Reading value "a" from the enclosing scope is fine
    b_out = a - b_in;
    keepgoing_out = my_local &gt; b_out;
    user_defined_val = b_in + b_in; // b_in and b_out are different variables
    /* End user-defined code */

    /* Implicitly defined-code */
    user_defined_vals[i] = user_defined_val // accumulate scan-output values
  }
  // int t = my_local; // Can't do this. my_local is not accessible here.

  // The values below are bound to the output variables of the loop and therefore accessible
  // b_out; user_defined_vals; keepgoing_out;
}</body></sourcecode>


<p id="_193b1642-ecae-7176-2455-1fe14ede5925">There are several things of note in this code snippet:</p>

<p id="_7c169438-1068-10bd-7006-eda301d48e41">1) Values from the enclosing scope (i.e. variable “a” here) are in scope and can    be referenced in the inputs of the loop. 2) Any values computed in the loop body that needs to be used in a subsequent    iteration or after the loop are modeled using a pair of variables in the loop-body,    consisting of an input variable (eg., b_in) and an output variable (eg., b_out).    These are referred to as loop-carried dependences. The loop operation node    supplies the input value of the input variable for the first iteration, and    returns the output value of the output variable produced by the final    iteration. 3) Scan_output variables are used to implicitly concatenate values computed across    all the iterations. In the above example, the value of user_defined_val computed    over all iterations are concatenated and returned as the value of user_defined_vals    after the loop. 4) Values created in the body cannot be accessed in the enclosing scope,    except using the mechanism described above.</p>

<p id="_99a1bdd9-8538-bd5a-cc8a-218f998200a2">Note that the semantics of this op support “diagonal” or “wavefront” execution. (See Step 3 here for an example: <link target="https://devblogs.nvidia.com/optimizing-recurrent-neural-networks-cudnn-5/"/>). Frontends should emit multi-layer RNNs as a series of While operators (with time being the inner looping dimension), with each successive layer consuming the scan_outputs from the previous layer, possibly going through several point-wise operators (e.g. dropout, residual connections, linear layer).</p>

<p id="_8a95d5a0-6358-a3f1-697a-b33fe5532562">The input/output of subgraph (produced by loop node) matching is based on order instead of name. The implementation will figure out the names based on this order.</p>

<dl id="_2b315ae7-1fe5-5cff-3b44-bd196695a7c8"><dt>Domain</dt>
<dd id="_8754298c-71a7-2803-7801-e0ca15d3fc80"><p id="_ad3baa88-2319-eb0b-43ea-cf270708cfdf"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_17213cc8-148a-6e3f-d4a1-cb7b81cecec0"><p id="_7ee4d5c3-8064-e240-9456-7c37b4e23a96">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_1a7ee1a6-2c06-8fbc-3217-d33b6c63a2d4"><p id="_b5ee967b-711f-586f-272b-2e405f4b43cf">1, 11, 13, 16, 19, 21, 23, 24</p>
</dd>
<dt>Inputs (2 — unbounded)</dt>
<dd id="_8dfb0275-69a0-df1b-79fd-6fff2edee090"><p id="_6c251d24-c389-c93a-da72-ea2824ea63e0"><tt>M (optional) : I</tt> — A maximum trip-count for the loop specified at runtime. Optional. Pass empty string to skip.<br/> <tt>cond (optional) : B</tt> — A boolean termination condition. Optional. Pass empty string to skip.<br/> <tt>v_initial (variadic, heterogeneous) : V</tt> — The initial values of any loop-carried dependencies (values that change across loop iterations)</p>
</dd>
<dt>Outputs (1 — unbounded)</dt>
<dd id="_6adac396-520f-ab97-ce6e-d823d8af8caf"><p id="_24f57de9-7c88-5237-c0a9-fa34dbc8ed56"><tt>v_final_and_scan_outputs (variadic, heterogeneous) : V</tt> — Final N loop carried dependency values then K scan_outputs. Scan outputs must be Tensors.</p>
</dd>
<dt>Attributes</dt>
<dd id="_a7287145-542c-8114-4d1d-ee4363742138"><p id="_65c6eedc-a256-7d43-1319-4895a1f265ab"><tt>body : graph (required)</tt> — The graph run each iteration. It has 2+N inputs: (iteration_num, condition, loop carried dependencies…​). It has 1+N+K outputs: (condition, loop carried dependencies…​, scan_outputs…​). Each scan_output is created by concatenating the value of the specified output value at the end of each iteration of the loop. It is an error if the dimensions or data type of these scan_outputs change across loop iterations.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_cf70dd35-bcd0-c604-6945-6d0bf6aaf185"><p id="_8f460021-8583-8b38-baab-b26ccda62af0"><tt>V : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2), seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(bfloat16)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128)), seq(tensor(float8e4m3fn)), seq(tensor(float8e4m3fnuz)), seq(tensor(float8e5m2)), seq(tensor(float8e5m2fnuz)), seq(tensor(uint4)), seq(tensor(int4)), seq(tensor(float4e2m1)), seq(tensor(float8e8m0)), seq(tensor(uint2)), seq(tensor(int2)), optional(seq(tensor(uint8))), optional(seq(tensor(uint16))), optional(seq(tensor(uint32))), optional(seq(tensor(uint64))), optional(seq(tensor(int8))), optional(seq(tensor(int16))), optional(seq(tensor(int32))), optional(seq(tensor(int64))), optional(seq(tensor(bfloat16))), optional(seq(tensor(float16))), optional(seq(tensor(float))), optional(seq(tensor(double))), optional(seq(tensor(string))), optional(seq(tensor(bool))), optional(seq(tensor(complex64))), optional(seq(tensor(complex128))), optional(tensor(uint8)), optional(tensor(uint16)), optional(tensor(uint32)), optional(tensor(uint64)), optional(tensor(int8)), optional(tensor(int16)), optional(tensor(int32)), optional(tensor(int64)), optional(tensor(bfloat16)), optional(tensor(float16)), optional(tensor(float)), optional(tensor(double)), optional(tensor(string)), optional(tensor(bool)), optional(tensor(complex64)), optional(tensor(complex128)), optional(tensor(float8e4m3fn)), optional(tensor(float8e4m3fnuz)), optional(tensor(float8e5m2)), optional(tensor(float8e5m2fnuz)), optional(tensor(uint4)), optional(tensor(int4)), optional(tensor(float4e2m1)), optional(tensor(float8e8m0)), optional(tensor(uint2)), optional(tensor(int2))</tt> — All Tensor, Sequence(Tensor), Optional(Tensor), and Optional(Sequence(Tensor)) types up to IRv13.<br/> <tt>I : tensor(int64)</tt> — tensor of int64, which should be a scalar.<br/> <tt>B : tensor(bool)</tt> — tensor of bool, which should be a scalar.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_e62994bd-73e7-b78d-935c-d778346d60bd"><p id="_31d9df75-ccb8-10fc-be7a-fbac94425b40"><tt>test_loop11</tt>, <tt>test_loop13_seq</tt>, <tt>test_loop16_seq_none</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_f72f8d7a-3118-4e70-79bd-2d0d52b8760e"><p id="_421a1fa9-ff08-9f39-af7b-0d93ee482023">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_5f1ad9bf-c413-2b48-37eb-5395b7ed7665" anchor="op-ai-onnx-default-lpnormalization" obligation="normative">
<title id="_ac4e5a38-0053-d78b-f62e-d776684e5ccd">LpNormalization</title>
<p id="_65dccefb-1147-0bcd-f962-55511782aec7">Given a matrix, apply Lp-normalization along the provided axis. The output is computed as:  <tt>output = input / Lp_norm(input, axis)</tt>. When the Lp norm is zero (i.e., all elements along the axis are zero), the output is defined to be zero to avoid division by zero.</p>

<dl id="_9f118859-bf4f-ced3-eb16-8c2be3a8592d"><dt>Domain</dt>
<dd id="_34698357-43a4-d441-bcbd-f0c15f20c3c7"><p id="_549c4dfa-4380-ad6b-699f-48d7acde74b7"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_95a26ff3-70fe-841a-efac-ff3d5d26b915"><p id="_6760a363-d4f2-85f6-e306-0f7f3cc53eb0">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_aaf39d6d-e005-fe6a-c858-897c2ac3cf69"><p id="_2cd92d70-f3e5-a39d-e5ec-86d219649f50">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_6b0688e8-0405-d6f2-e0f5-d41f08a9b925"><p id="_4ee25d53-3225-14e1-aff9-1226ce6293c5"><tt>input (differentiable) : T</tt> — Input matrix</p>
</dd>
<dt>Outputs</dt>
<dd id="_0ead0b33-5069-d0a6-42d8-5941c538e772"><p id="_f33e5af0-9485-7f8b-16c2-930eac6ed851"><tt>output (differentiable) : T</tt> — Matrix after normalization</p>
</dd>
<dt>Attributes</dt>
<dd id="_35c932f0-8198-f42a-ddd1-e3f951dc9220"><p id="_b38b2962-73a3-0745-d6c0-1b2845b4672d"><tt>axis : int (default is -1)</tt> — The axis on which to apply normalization, -1 mean last axis.<br/> <tt>p : int (default is 2)</tt> — The order of the normalization, only 1 or 2 are supported.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_ce6b061d-d2ac-3689-b080-368c77038312"><p id="_86c62534-2e5c-9b95-c1b2-cf8cfb236840"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_c9ca5932-c9bd-9196-9084-5a0941e4ee7d"><p id="_3302563e-8f1c-02da-e72f-252329da555e"><tt>test_lpnormalization_default</tt>, <tt>test_l1normalization_axis_0</tt>, <tt>test_l1normalization_axis_1</tt>, <tt>test_l1normalization_axis_last</tt>, <tt>test_l2normalization_axis_0</tt>, <tt>test_l2normalization_axis_1</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_531df9d1-bd10-0ad1-c7c6-fb6c54a0bdb1"><p id="_2999f228-e566-2d8e-c6d3-2298ed0f8eaa">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_5ac012dc-9f66-d7fa-d254-3ed5f9f38808" anchor="op-ai-onnx-default-lppool" obligation="normative">
<title id="_713e60a4-7a4c-42eb-6aae-2842a5d21e55">LpPool</title>
<p id="_3dc24beb-89f0-ce00-dcf0-68a1c7b087c3">LpPool consumes an input tensor X and applies Lp pooling across  the tensor according to kernel sizes, stride sizes, and pad lengths.  Lp pooling consisting of computing the Lp norm on all values of a subset  of the input tensor according to the kernel size and downsampling the  data into the output tensor Y for further processing. The output spatial shape will be following:</p>

<sourcecode id="_d8872f98-c3a1-55af-c4cf-831cbf920b84" unnumbered="true"><body> output_spatial_shape[i] = floor((input_spatial_shape[i] + pad_shape[i] - {kernelSpatialShape}) / strides_spatial_shape[i] + 1)</body></sourcecode>


<p id="_25e6c261-ce0b-2516-7b72-19f8bd53723a">or</p>

<sourcecode id="_66768c89-1f65-d857-b2c9-25bbe658154f" unnumbered="true"><body> output_spatial_shape[i] = ceil((input_spatial_shape[i] + pad_shape[i] - {kernelSpatialShape}) / strides_spatial_shape[i] + 1)</body></sourcecode>


<p id="_5f045361-696e-bc5a-4f0d-490515b4015d">if ceil_mode is enabled <tt>pad_shape[i]</tt> is the sum of pads along axis <tt>i</tt>.</p>

<p id="_911cbb6f-f3f2-7c41-378e-22f5c3d94887"><tt>auto_pad</tt> is a DEPRECATED attribute. If you are using them currently, the output spatial shape will be following:</p>

<sourcecode id="_7a835955-f84a-0fcf-373f-3f8ae5e099c0" unnumbered="true"><body> VALID: output_spatial_shape[i] = ceil((input_spatial_shape[i] - {kernelSpatialShape} + 1) / strides_spatial_shape[i])
 SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides_spatial_shape[i])</body></sourcecode>


<p id="_d38c31ad-2df2-67c8-2ecb-3fb1f89390cd">And pad shape will be following if <tt>SAME_UPPER</tt> or <tt>SAME_LOWER</tt>:</p>

<sourcecode id="_a659af13-aaa2-a5ac-ae37-d9ea10ed5521" unnumbered="true"><body> pad_shape[i] = (output_spatial_shape[i] - 1) * strides_spatial_shape[i] + {kernelSpatialShape} - input_spatial_shape[i]</body></sourcecode>


<dl id="_85fbbdd2-1dc7-a0b7-a7a9-4b5e4d35de91"><dt>Domain</dt>
<dd id="_0724c9f9-c75a-153c-cf73-c6ab83d2fab9"><p id="_00c58f73-b396-5c93-8966-21d3a7d47aee"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_b1bc3104-55e1-1c17-1f05-c8bf05ecca4f"><p id="_a16a0f56-14f4-c2f7-0301-500e6ee4ee08">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_f86abdb3-94a5-fb66-317e-5e51e8fef0ac"><p id="_3c35372e-18ad-1483-deb3-fe685926ab81">1, 2, 11, 18</p>
</dd>
<dt>Inputs</dt>
<dd id="_7a9a7175-9ed3-6a71-70e4-dc1c891006f2"><p id="_c34d88bd-4528-59e8-809d-44f34355a4f7"><tt>X (differentiable) : T</tt> — Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 …​ Dn), where N is the batch size.</p>
</dd>
<dt>Outputs</dt>
<dd id="_697b586a-4c17-817d-5292-beaa5b2eda6f"><p id="_4296767c-8b32-364f-bf35-eaa0d982db00"><tt>Y (differentiable) : T</tt> — Output data tensor from Lp pooling across the input tensor. Dimensions will vary based on various kernel, stride, and pad sizes.</p>
</dd>
<dt>Attributes</dt>
<dd id="_49f98646-5b22-3620-7240-b56f3ba0fd26"><p id="_6b3681af-5434-1059-3907-be6496f9ea2c"><tt>auto_pad : string (default is NOTSET)</tt> — auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID. Where default value is NOTSET, which means explicit padding is used. SAME_UPPER or SAME_LOWER mean pad the input so that <tt>output_shape[i] = ceil(input_shape[i] / strides[i])</tt> for each axis <tt>i</tt>. The padding is split between the two sides equally or almost equally (depending on whether it is even or odd). In case the padding is an odd number, the extra padding is added at the end for SAME_UPPER and at the beginning for SAME_LOWER.<br/> <tt>ceil_mode : int (default is 0)</tt> — Whether to use ceil or floor (default) to compute the output shape.<br/> <tt>dilations : list of ints</tt> — dilation value along each spatial axis of the filter. If not present, the dilation defaults is 1 along each spatial axis.<br/> <tt>kernel_shape : list of ints (required)</tt> — The size of the kernel along each axis.<br/> <tt>p : int (default is 2)</tt> — p value of the Lp norm used to pool over the input data.<br/> <tt>pads : list of ints</tt> — Padding for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis. <tt>pads</tt> format should be as follow [x1_begin, x2_begin…​x1_end, x2_end,…​], where xi_begin the number of pixels added at the beginning of axis <tt>i</tt> and xi_end, the number of pixels added at the end of axis <tt>i</tt>. This attribute cannot be used simultaneously with auto_pad attribute. If not present, the padding defaults to 0 along start and end of each spatial axis.<br/> <tt>strides : list of ints</tt> — Stride along each spatial axis. If not present, the stride defaults to 1 along each spatial axis.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_2412a810-1444-2a5c-a029-492df6be2d06"><p id="_6002820e-b997-6ca4-a72c-5bfaa468fbeb"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_05a4d5d2-2a0b-29d9-ac51-d21c360b0d33"><p id="_cf5d156f-7c03-ceca-fa05-b5811286841b"><tt>test_lppool_1d_default</tt>, <tt>test_lppool_2d_default</tt>, <tt>test_lppool_2d_dilations</tt>, <tt>test_lppool_2d_pads</tt>, <tt>test_lppool_2d_same_lower</tt>, <tt>test_lppool_2d_same_upper</tt>, <tt>test_lppool_2d_strides</tt>, <tt>test_lppool_3d_default</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_4856ebd2-ab25-89b8-26cd-8111ecfe03e5"><p id="_536b328e-986c-8412-f794-0092d6c61e04">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_a05f62bd-c33e-e17a-a2f1-f35f0557a6b3" anchor="op-ai-onnx-default-matmul" obligation="normative">
<title id="_6597ad50-0cd5-472e-ec34-82ce4cba61c0">MatMul</title>
<p id="_5eb5b8fe-7752-13a9-b49a-e4007fd7037d">Matrix product that behaves like <link target="https://numpy.org/doc/stable/reference/generated/numpy.matmul.html">numpy.matmul</link>.</p>

<dl id="_ee504f45-f25e-85ba-72b7-3c199d4c21be"><dt>Domain</dt>
<dd id="_dea98968-9c34-2540-f5bd-e482e44917e7"><p id="_7cda0c1e-b16d-5ff2-4661-652951705db8"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_72f8faec-5f84-85a0-01d6-4ec267bef511"><p id="_44a97ead-0f7d-0ec0-1241-5518e93e819c">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_628f6690-6c07-3bf5-d311-3ce7ebe925fe"><p id="_238b49e9-8ba3-5e8d-6f5f-4588fcf41399">1, 9</p>
</dd>
<dt>Inputs</dt>
<dd id="_568f5764-07f4-9cba-0dd1-97fc85572453"><p id="_77693270-1b1d-8808-4717-9429557aef3f"><tt>A (differentiable) : T</tt> — N-dimensional matrix A<br/> <tt>B (differentiable) : T</tt> — N-dimensional matrix B</p>
</dd>
<dt>Outputs</dt>
<dd id="_5b0911a2-28c7-7815-ecd9-d9c8ca6ab462"><p id="_40e2b6a3-65b8-8f92-1d27-6be10888021d"><tt>Y (differentiable) : T</tt> — Matrix multiply results from A * B</p>
</dd>
<dt>Attributes</dt>
<dd id="_00543f82-50a1-c82f-8b0d-afca8145266c"><p id="_92cbe4f9-0848-9050-0293-5d8e6dd15f46">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_01315842-f603-1102-c2b0-9eff51c44f43"><p id="_0f2570f9-2705-fe65-4550-463145a06b5f"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(uint32), tensor(uint64), tensor(int32), tensor(int64), tensor(bfloat16)</tt> — Constrain input and output types to float/int tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_4e59cf86-d373-d3b1-9be2-1f5085966739"><p id="_19b0def1-a3f7-43ea-c5a6-625302a50e56"><tt>test_matmul_2d</tt>, <tt>test_matmul_3d</tt>, <tt>test_matmul_4d</tt>, <tt>test_matmul_bcast</tt>, <tt>test_matmul_1d_3d</tt>, <tt>test_matmul_4d_1d</tt>, <tt>test_matmul_1d_1d</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_671a9137-b417-a1bb-46c0-149864e48452"><p id="_9d44328d-aadc-4273-2b59-5bc1517de499">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_a1739c39-455c-ae18-4e47-4496bc66d17a" anchor="op-ai-onnx-default-matmulinteger" obligation="normative">
<title id="_51f2febb-de30-d5a9-bd4b-7ff0915c25fb">MatMulInteger</title>
<p id="_d2e22102-5d5a-32be-99f3-d718373e3231">Matrix product that behaves like <link target="https://numpy.org/doc/stable/reference/generated/numpy.matmul.html">numpy.matmul</link>. The production MUST never overflow. The accumulation may overflow if and only if in 32 bits.</p>

<dl id="_04562380-f9c4-a85f-64da-85005aca4782"><dt>Domain</dt>
<dd id="_71da2717-c308-e7d0-9443-51d7ed36597e"><p id="_7db88c04-2896-9ec6-f9d5-512467a0ce99"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_b5e37e0c-81cc-5fad-3654-1e26bfbd1f58"><p id="_c307cfec-f3e6-936c-b6e8-dddbe9dd2af7">10</p>
</dd>
<dt>Inputs (2 — 4)</dt>
<dd id="_570ba1a6-e30e-be1f-e3b9-c332df5874fd"><p id="_812c7f5f-5a66-54b8-244e-20f0d8252490"><tt>A (non-differentiable) : T1</tt> — N-dimensional matrix A<br/> <tt>B (non-differentiable) : T2</tt> — N-dimensional matrix B<br/> <tt>a_zero_point (optional, non-differentiable) : T1</tt> — Zero point tensor for input ‘A’. It’s optional and default value is 0. It could be a scalar or N-D tensor. Scalar refers to per tensor quantization whereas N-D refers to per row quantization. If the input is 2D of shape [M, K] then zero point tensor may be an M element vector [zp_1, zp_2, …​, zp_M]. If the input is N-D tensor with shape [D1, D2, M, K] then zero point tensor may have shape [D1, D2, M, 1].<br/> <tt>b_zero_point (optional, non-differentiable) : T2</tt> — Zero point tensor for input ‘B’. It’s optional and default value is 0. It could be a scalar or a N-D tensor, Scalar refers to per tensor quantization whereas N-D refers to per col quantization. If the input is 2D of shape [K, N] then zero point tensor may be an N element vector [zp_1, zp_2, …​, zp_N]. If the input is N-D tensor with shape [D1, D2, K, N] then zero point tensor may have shape [D1, D2, 1, N].</p>
</dd>
<dt>Outputs</dt>
<dd id="_ffc55a4e-bd78-4127-e407-33fa9a274270"><p id="_128756da-3a05-b7ad-c62a-7adb0e313d63"><tt>Y (non-differentiable) : T3</tt> — Matrix multiply results from A * B</p>
</dd>
<dt>Attributes</dt>
<dd id="_0455eb07-1a84-1e3a-4952-5931c596d61b"><p id="_c7bc3316-ea04-7f15-ce64-7142d72ac21f">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_d26a7a48-c479-1caf-b4da-4703a83492a3"><p id="_c3d12063-9d5e-9081-1230-85344cd3517b"><tt>T1 : tensor(int8), tensor(uint8)</tt> — Constrain input A data type to 8-bit integer tensor.<br/> <tt>T2 : tensor(int8), tensor(uint8)</tt> — Constrain input B data type to 8-bit integer tensor.<br/> <tt>T3 : tensor(int32)</tt> — Constrain output Y data type as 32-bit integer tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_155c4fb8-7b96-f287-2113-1a91ecd3b5bd"><p id="_bf59f88e-4e68-e3b6-0547-d613debe6e1c"><tt>test_matmulinteger</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_3b41897a-a729-ef92-d831-67081ecadf9b"><p id="_856cbd46-887f-3fd8-79b5-8e3598366492">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_03ced333-3692-d7f4-f336-150adc585c99" anchor="op-ai-onnx-default-max" obligation="normative">
<title id="_d597e593-54bd-8b6a-75e4-ac0adb07f26e">Max</title>
<p id="_2b5b9e25-75c8-1589-0a52-e8098c42d6c2">Element-wise max of each of the input tensors (with Numpy-style broadcasting support). All inputs and outputs must have the same data type. This operator supports  <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_2aa16ea2-0137-32cd-92f2-b899c00fd821"><dt>Domain</dt>
<dd id="_503cb5b5-775a-1efb-c23c-14b0f250b3c9"><p id="_4a077e7f-92ef-0778-4aa6-d4996344c7fe"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_e5cc42bc-665d-4f73-df05-d16155f23b18"><p id="_c48eb40f-ada0-3d02-db10-2316102acdee">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_daf51b54-d0ac-3e8f-de13-3dabccc86c3e"><p id="_7bb852cf-60c4-2831-2166-7c5e29853799">1, 6, 8, 12</p>
</dd>
<dt>Inputs (1 — unbounded)</dt>
<dd id="_46fcb975-01cf-33e6-72c6-834044d55bc0"><p id="_a7ecb58a-27ad-4602-bad9-756079004f2e"><tt>data_0 (variadic, differentiable) : T</tt> — List of tensors for max.</p>
</dd>
<dt>Outputs</dt>
<dd id="_a31feaa1-69d5-e8ac-26a9-842db85d9b7b"><p id="_d0e4ae1e-73f0-824f-f313-b2c3a65f5b09"><tt>max (differentiable) : T</tt> — Output tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_f27b715f-9c6f-7e7f-f2af-c5fd87953157"><p id="_62781f1d-54b9-5b89-c754-492aef7fcc8b">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_267e24e1-3317-4f28-fc3f-1e452462d938"><p id="_7ec090c7-fa3b-f5df-afc2-6f3a52b1955c"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_574c8a79-d335-631f-b607-4e79d381b4a0"><p id="_36e5b900-429e-3993-837b-27986d30a4fe"><tt>test_max_example</tt>, <tt>test_max_one_input</tt>, <tt>test_max_two_inputs</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_9a135e23-4220-61f1-4a73-bf393ca253c1"><p id="_b0bde2b3-26e6-ea25-7b93-4198ec6aceee">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_bd83bef2-65f2-4a2c-d522-31b26b0d293f" anchor="op-ai-onnx-default-maxpool" obligation="normative">
<title id="_fce33666-cad8-3c4a-1e16-8b70cd29ada4">MaxPool</title>
<p id="_e340e887-4dad-bc5f-685f-2855c4267175">MaxPool consumes an input tensor X and applies max pooling across  the tensor according to kernel sizes, stride sizes, and pad lengths.  max pooling consisting of computing the max on all values of a  subset of the input tensor according to the kernel size and downsampling the  data into the output tensor Y for further processing. The output spatial shape is calculated differently  depending on whether explicit padding is used, where pads is employed, or auto padding is used, where auto_pad is utilized.  With explicit padding (<link target="https://pytorch.org/docs/stable/generated/torch.nn.MaxPool2d.html?highlight=maxpool#torch.nn.MaxPool2d):"/></p>

<sourcecode id="_86eb00fb-084f-1ee0-662f-d982f78cdaf3" unnumbered="true"><body> output_spatial_shape[i] = floor((input_spatial_shape[i] + pad_shape[i] - dilation[i] * (kernel_shape[i] - 1) - 1) / strides_spatial_shape[i] + 1)</body></sourcecode>


<p id="_6b07adad-5e63-6ff2-83a1-c2126d19f1dc">or</p>

<sourcecode id="_cf6df32d-e895-a1bd-83c6-7e33f77d0869" unnumbered="true"><body> output_spatial_shape[i] = ceil((input_spatial_shape[i] + pad_shape[i] - dilation[i] * (kernel_shape[i] - 1) - 1) / strides_spatial_shape[i] + 1)</body></sourcecode>


<p id="_ee617b67-7e0d-a375-fb75-b69eaff944f7">if ceil_mode is enabled. <tt>pad_shape[i]</tt> is the sum of pads along axis <tt>i</tt>. Sliding windows that would start in the right padded region are ignored.</p>

<p id="_b463db2c-ebbc-39c6-ea37-3939649b5fc6"><tt>auto_pad</tt> is a DEPRECATED attribute. If you are using them currently, the output spatial shape will be following when ceil_mode is enabled:</p>

<sourcecode id="_1ed1bfff-09c1-a993-ca9a-61b6235638c8" unnumbered="true"><body> VALID: output_spatial_shape[i] = ceil((input_spatial_shape[i] - ((kernel_spatial_shape[i] - 1) * dilations[i] + 1) + 1) / strides_spatial_shape[i])
 SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides_spatial_shape[i])</body></sourcecode>


<p id="_bfb863fe-1f45-6699-1fbb-aeac0f8f49b8">or when ceil_mode is disabled (<link target="https://www.tensorflow.org/api_docs/python/tf/keras/layers/AveragePooling2D):"/></p>

<sourcecode id="_defbf5b7-08ce-d348-fa6e-55f228195510" unnumbered="true"><body> VALID: output_spatial_shape[i] = floor((input_spatial_shape[i] - ((kernel_spatial_shape[i] - 1) * dilations[i] + 1)) / strides_spatial_shape[i]) + 1
 SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = floor((input_spatial_shape[i] - 1) / strides_spatial_shape[i]) + 1</body></sourcecode>


<p id="_457ca23a-c592-399d-8ef0-494dbe05e3e0">And pad shape will be following if <tt>SAME_UPPER</tt> or <tt>SAME_LOWER</tt>:</p>

<sourcecode id="_552ce45b-4809-5ae2-4388-dc85302e25b6" unnumbered="true"><body> pad_shape[i] = (output_spatial_shape[i] - 1) * strides_spatial_shape[i] + ((kernel_spatial_shape[i] - 1) * dilations[i] + 1) - input_spatial_shape[i]</body></sourcecode>


<p id="_9b91e93b-398a-1b4f-4ee3-ab8dc5eddb88">The output of each pooling window is maximum number of elements exclude pad.</p>

<dl id="_53494251-279e-f3ee-6634-18f4dd3f865f"><dt>Domain</dt>
<dd id="_ff61a0a9-51a4-1043-9f1a-eefced52361b"><p id="_7fa0ee6c-19d0-47c4-2f00-dfdccdaf1dc8"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_4e5bc95e-e27c-bfc4-0fc6-02003020064c"><p id="_9c2a9f32-3492-0c4b-157f-38054880170e">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_26aab41b-4b26-c715-5fd2-e89dd291f548"><p id="_ccecf829-9b5a-a335-7ede-7305aefac6f9">1, 8, 10, 11, 12</p>
</dd>
<dt>Inputs</dt>
<dd id="_8aadb012-26a6-1549-b2b9-344eee823708"><p id="_501fa594-fa21-a6a9-09b0-3b8f4d2648e5"><tt>X (differentiable) : T</tt> — Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 …​ Dn), where N is the batch size. Optionally, if dimension denotation is in effect, the operation expects the input data tensor to arrive with the dimension denotation of [DATA_BATCH, DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE …​].</p>
</dd>
<dt>Outputs (1 — 2)</dt>
<dd id="_5d31676d-1d8a-5934-99e8-50aabd3c017f"><p id="_4118aa48-d318-14c6-6290-bb01379beba2"><tt>Y (differentiable) : T</tt> — Output data tensor from average or max pooling across the input tensor. Dimensions will vary based on various kernel, stride, and pad sizes. Floor value of the dimension is used<br/> <tt>Indices (optional, non-differentiable) : I</tt> — Indices tensor from max pooling across the input tensor. The dimensions of indices are the same as output tensor. The values in indices of are the indices of the selected values during pooling. The indices are computed as flatten 1-D tensor, and the indices do not consider padding. So the values in indices are in [0, N x C x D1 x …​ x Dn).</p>
</dd>
<dt>Attributes</dt>
<dd id="_6c6d7e4a-4ba8-b8b4-9f3b-40ff08785549"><p id="_2c7d6a55-8bc2-a087-3754-6be5850c8067"><tt>auto_pad : string (default is NOTSET)</tt> — auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID. Where default value is NOTSET, which means explicit padding is used. SAME_UPPER or SAME_LOWER mean pad the input so that <tt>output_shape[i] = ceil(input_shape[i] / strides[i])</tt> for each axis <tt>i</tt>. The padding is split between the two sides equally or almost equally (depending on whether it is even or odd). In case the padding is an odd number, the extra padding is added at the end for SAME_UPPER and at the beginning for SAME_LOWER.<br/> <tt>ceil_mode : int (default is 0)</tt> — Whether to use ceil or floor (default) to compute the output shape.<br/> <tt>dilations : list of ints</tt> — Dilation value along each spatial axis of filter. If not present, the dilation defaults to 1 along each spatial axis.<br/> <tt>kernel_shape : list of ints (required)</tt> — The size of the kernel along each axis.<br/> <tt>pads : list of ints</tt> — Padding for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis. <tt>pads</tt> format should be as follow [x1_begin, x2_begin…​x1_end, x2_end,…​], where xi_begin the number of pixels added at the beginning of axis <tt>i</tt> and xi_end, the number of pixels added at the end of axis <tt>i</tt>. This attribute cannot be used simultaneously with auto_pad attribute. If not present, the padding defaults to 0 along start and end of each spatial axis.<br/> <tt>storage_order : int (default is 0)</tt> — The storage order of the tensor. 0 is row major, and 1 is column major. This attribute is used only to convert an n-tuple index value into a single integer value for producing the second output.<br/> <tt>strides : list of ints</tt> — Stride along each spatial axis. If not present, the stride defaults to 1 along each spatial axis.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_267c37b9-8388-c8ab-c9f2-0e1329bb676b"><p id="_ede414dd-c58e-81a3-a52b-2b009ebb584f"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(int8), tensor(uint8)</tt> — Constrain input and output types to float and 8 bit tensors.<br/> <tt>I : tensor(int64)</tt> — Constrain index tensor to int64</p>
</dd>
<dt>Test vectors</dt>
<dd id="_af423227-8d38-6276-e42f-2eae9c3c1f23"><p id="_3e883509-82a9-28d1-5fe3-e99261230768"><tt>test_maxpool_1d_default</tt>, <tt>test_maxpool_2d_ceil</tt>, <tt>test_maxpool_2d_ceil_output_size_reduce_by_one</tt>, <tt>test_maxpool_2d_default</tt>, <tt>test_maxpool_2d_dilations</tt>, <tt>test_maxpool_2d_pads</tt>, <tt>test_maxpool_2d_precomputed_pads</tt>, <tt>test_maxpool_2d_precomputed_same_upper</tt>, <tt>test_maxpool_2d_precomputed_strides</tt>, <tt>test_maxpool_2d_same_lower</tt>, <tt>test_maxpool_2d_same_upper</tt>, <tt>test_maxpool_2d_strides</tt>, <tt>test_maxpool_2d_uint8</tt>, <tt>test_maxpool_3d_default</tt>, <tt>test_maxpool_3d_dilations</tt>, <tt>test_maxpool_3d_dilations_use_ref_impl</tt>, <tt>test_maxpool_3d_dilations_use_ref_impl_large</tt>, <tt>test_maxpool_with_argmax_2d_precomputed_pads</tt>, <tt>test_maxpool_with_argmax_2d_precomputed_strides</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_fb187f86-22a7-5d4a-8095-4a5588aac73f"><p id="_566f88e4-1000-997d-8b5d-efa03c698e4a">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_3ff6a98a-d819-c016-989b-f9f36c64bcf6" anchor="op-ai-onnx-default-maxroipool" obligation="normative">
<title id="_d9def539-16a2-7023-01da-e236b0afc882">MaxRoiPool</title>
<p id="_841a59db-2f26-bb30-75c3-c3b5105626ae">ROI max pool consumes an input tensor X and region of interests (RoIs) to  apply max pooling across each RoI, to produce output 4-D tensor of shape  (num_rois, channels, pooled_shape[0], pooled_shape[1]).</p>

<dl id="_80208e75-3719-90bf-e31a-18f542b11417"><dt>Domain</dt>
<dd id="_c6637d7b-52cb-5058-02d8-90740bce16f8"><p id="_152fd6ef-d374-185e-ad87-bc15e265a377"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_24991439-a4f9-2230-a344-c19f2a468123"><p id="_f59781bf-131f-fd24-67e9-36a7f7ae2546">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_671fd0a0-8f18-3d87-4ac5-7c217dd9723c"><p id="_5d447011-8914-b118-7fb0-1e77f58eedf2">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_0e809495-6e8f-433e-e7d1-77d63cf7e9e1"><p id="_6680c4eb-eb1b-b320-55da-84090f5d03bb"><tt>X (differentiable) : T</tt> — Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data.<br/> <tt>rois (non-differentiable) : T</tt> — RoIs (Regions of Interest) to pool over. Should be a 2-D tensor of shape (num_rois, 5) given as [[batch_id, x1, y1, x2, y2], …​].</p>
</dd>
<dt>Outputs</dt>
<dd id="_5f5e0927-28ff-7a3e-72a8-5e8b77d1def8"><p id="_f8258e15-07d2-4bac-36aa-a87ebfde05a9"><tt>Y (differentiable) : T</tt> — RoI pooled output 4-D tensor of shape (num_rois, channels, pooled_shape[0], pooled_shape[1]).</p>
</dd>
<dt>Attributes</dt>
<dd id="_df963bcd-5df2-0dbe-9198-2f2a0b0723ee"><p id="_0ad52bb9-299b-f7dd-0f8c-b92a8a2cf3f5"><tt>pooled_shape : list of ints (required)</tt> — ROI pool output shape (height, width).<br/> <tt>spatial_scale : float (default is 1.0)</tt> — Multiplicative spatial scale factor to translate ROI coordinates from their input scale to the scale used when pooling.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_07c1380f-534b-bff7-1dbf-63eff35e71db"><p id="_1ca3fa5d-0494-4012-ca22-cfc7e7f8d0ad"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_2eb49cc6-8fe3-4bcd-71c4-0d6ae045f648"><p id="_b938dc3b-5e28-7e6b-1180-410826060ee8">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_ea8d478e-b8c0-0fa8-e7dd-648f267f61ba"><p id="_d454a5a4-6708-e9aa-bb50-0502480260d9">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_be096b59-03f6-7bdf-71e1-b483115d1acc" anchor="op-ai-onnx-default-maxunpool" obligation="normative">
<title id="_32f04645-e20d-c51f-7ebb-65a468819d0e">MaxUnpool</title>
<p id="_19c828ef-ea8a-dbe9-e325-78040ce533ec">MaxUnpool essentially computes the partial inverse of the MaxPool op.  The input information to this op is typically the output information from a MaxPool op. The first  input tensor X is the tensor that needs to be unpooled, which is typically the pooled tensor (first output)  from MaxPool. The second input tensor, I, contains the indices to the (locally maximal) elements corresponding  to the elements in the first input tensor X. Input tensor I is typically the second output of the MaxPool op.  The third (optional) input is a tensor that specifies the output size of the unpooling operation.</p>

<p id="_58427ae1-04de-079d-8e5e-dbce0f442b89">MaxUnpool is intended to do ‘partial’ inverse of the MaxPool op. ‘Partial’ because all the non-maximal  values from the original input to MaxPool are set to zero in the output of the MaxUnpool op. Pooling  the result of an unpooling operation should give back the original input to the unpooling op.</p>

<p id="_74c76757-246d-0c0b-9761-7e3c346d5476">MaxUnpool can produce the same output size for several input sizes, which makes unpooling op ambiguous.  The third input argument, output_size, is meant to disambiguate the op and produce output tensor of  known/predictable size.</p>

<p id="_6c939bdc-7f64-f9ce-2844-bfaf67ef91a1">In addition to the inputs, MaxUnpool takes three attributes, namely kernel_shape, strides, and pads,  which define the exact unpooling op. The attributes typically have the same values as the corresponding  pooling op that the unpooling op is trying to invert.</p>

<dl id="_633a4873-b1f0-9286-94d9-008b25b9d77e"><dt>Domain</dt>
<dd id="_367e1573-4114-dcbb-ab6a-50562aa2b690"><p id="_70bd1534-7818-c190-76b5-801e3308b9ad"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_e6263c42-b874-a393-59fd-551e8b70af1c"><p id="_678d4b76-81ac-c1d9-28fc-673df0b9429a">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_43c25f90-1ad6-df60-911b-86a6b167a4b8"><p id="_974bdfec-b995-b6c7-a70b-3fa3f2e22b50">9, 11</p>
</dd>
<dt>Inputs (2 — 3)</dt>
<dd id="_1a1ef92a-530f-f805-345d-72b47eb18309"><p id="_8d1e1148-5759-e3a2-92f1-0daa76578309"><tt>X (differentiable) : T1</tt> — Input data tensor that has to be unpooled. This tensor is typically the first output of the MaxPool op.Dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non-image case, the dimensions are in the form of (N x C x D1 x D2 …​ Dn), where N is the batch size. Optionally, if dimension denotation is in effect, the operation expects the input data tensor to arrive with the dimension denotation of [DATA_BATCH, DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE …​].<br/> <tt>I (non-differentiable) : T2</tt> — Input data tensor containing the indices corresponding to elements in the first input tensor X.This tensor is typically the second output of the MaxPool op.Dimensions must be the same as input tensor X. The indices are linear, i.e. computed considering the tensor as flattened 1-D tensor, assuming row-major storage. Also, the linear indices should not consider padding. So the values in indices are in the range [0, N x C x D1 x …​ x Dn).<br/> <tt>output_shape (optional, non-differentiable) : T2</tt> — The shape of the output can be explicitly set which will cause pads values to be auto generated. If ‘output_shape’ is specified, ‘pads’ values are ignored.</p>
</dd>
<dt>Outputs</dt>
<dd id="_15852489-36ef-95bf-de4a-f9771d924ce6"><p id="_c5e5d91f-4883-ba2a-3c1b-2a3ac4e29291"><tt>output (differentiable) : T1</tt> — Output data tensor that contains the result of the unpooling.</p>
</dd>
<dt>Attributes</dt>
<dd id="_2a561d2d-5be5-3630-4ea5-0b4ceee682f8"><p id="_88e98895-6f3c-bbb1-4fa6-4f0700173bbb"><tt>kernel_shape : list of ints (required)</tt> — The size of the kernel along each axis.<br/> <tt>pads : list of ints</tt> — Padding for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0. The value represent the number of pixels added to the beginning and end part of the corresponding axis. <tt>pads</tt> format should be as follow [x1_begin, x2_begin…​x1_end, x2_end,…​], where xi_begin the number of pixels added at the beginning of axis <tt>i</tt> and xi_end, the number of pixels added at the end of axis <tt>i</tt>. This attribute cannot be used simultaneously with auto_pad attribute. If not present, the padding defaults to 0 along start and end of each spatial axis.<br/> <tt>strides : list of ints</tt> — Stride along each spatial axis. If not present, the stride defaults to 1 along each spatial axis.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_b5f3109a-7b1a-92a5-2857-85adb02d4689"><p id="_25d706a3-06b0-26bd-20a3-2e6ee486a6cc"><tt>T1 : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.<br/> <tt>T2 : tensor(int64)</tt> — Constrain index tensor to int64</p>
</dd>
<dt>Test vectors</dt>
<dd id="_859925e3-a8a3-59f7-39bc-647ee71ec69b"><p id="_6056c1c6-e5a0-ab75-b9c0-646009302438"><tt>test_maxunpool_export_with_output_shape</tt>, <tt>test_maxunpool_export_without_output_shape</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_8937efbb-1cf4-542c-bb85-792f8297c717"><p id="_31345502-1f01-9236-f135-d38e5e653ef9">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_fc6b8b9a-929c-d89d-8086-6e95a4aa244a" anchor="op-ai-onnx-default-mean" obligation="normative">
<title id="_f72ece1a-7da0-c417-363b-97965d68fdf9">Mean</title>
<p id="_e56220eb-b7cf-3ac4-7275-a0c6d38e3a7d">Element-wise mean of each of the input tensors (with Numpy-style broadcasting support). All inputs and outputs must have the same data type. This operator supports  <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_35ea5954-33e5-9631-2b6b-c7826544b747"><dt>Domain</dt>
<dd id="_b143ec3b-03d9-afef-f73c-33bb856c065f"><p id="_1bf8c3d1-cd3d-8f1a-8e09-1dda9383c4e5"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_ccb1b138-806b-6f76-8f8a-3817b956dbc4"><p id="_4cdf1c39-a375-cd45-3f1d-a27b869fc657">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_ecb05efe-4f72-4cba-80dc-7532825cca9e"><p id="_b28ff231-77e2-5630-48d6-1855fad5453a">1, 6, 8</p>
</dd>
<dt>Inputs (1 — unbounded)</dt>
<dd id="_92742f8f-4f79-a7bd-0f97-1cf44c55182d"><p id="_0dfce070-0574-723e-6133-f3ad10ed0e32"><tt>data_0 (variadic, differentiable) : T</tt> — List of tensors for mean.</p>
</dd>
<dt>Outputs</dt>
<dd id="_ba7004ef-8f98-8e04-b8e8-f1a2e77b324b"><p id="_18220131-b656-27ab-cabd-a9eb5deef971"><tt>mean (differentiable) : T</tt> — Output tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_016bab2b-8768-acbc-4aa4-d8f6caab8863"><p id="_e441629f-e2b9-8171-bfd9-85da8304b48d">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_4c407203-d36e-6e9b-40ca-97cc38fd251e"><p id="_7ad2e7d9-4352-f251-4c92-a8345bd8587f"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_d9f34aaa-c261-ed2a-78db-bac032c37be6"><p id="_9b8f6761-dc86-2721-421f-1c18e192f4b5"><tt>test_mean_example</tt>, <tt>test_mean_one_input</tt>, <tt>test_mean_two_inputs</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_e7456a9c-118a-63ff-13b0-7718fce39a79"><p id="_1bf18407-6152-6a36-0776-bf5fa7b2d2b7">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_2592f1e9-3ced-a663-08c5-650e7764825a" anchor="op-ai-onnx-default-meanvariancenormalization" obligation="normative">
<title id="_235b4365-0aba-7577-0c06-18c5beb80d02">MeanVarianceNormalization</title>
<p id="_812b9892-e369-b741-1e75-d0952aac9fa3">A MeanVarianceNormalization Function: Perform mean variance normalization       on the input tensor X using formula:  <tt>(X-EX)/sqrt(E(X-EX)^2)</tt></p>

<dl id="_79864cc5-5ced-cbaa-b546-906c7e9982c0"><dt>Domain</dt>
<dd id="_0ef1e452-88d7-c678-6c4a-6451ad742220"><p id="_75c2b101-a92a-9e2a-9784-a39f819beddc"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_452b6139-4548-8fbe-6e9a-fa9bc15a3994"><p id="_1d86a29a-ab33-1a46-c54c-22e60e908ad6">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_b84fb5dd-cbf9-a2bf-6055-530bdc07193f"><p id="_8478ccc7-5301-4629-b797-ce5c09c67bca">9</p>
</dd>
<dt>Inputs</dt>
<dd id="_a254a0c2-6bfc-7da4-6746-597c53eaf28a"><p id="_bc0cd2c3-2dcd-d31b-1394-222b0bb8ffa0"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_e2f0fbe2-9778-81c5-adeb-fc6e2093ec40"><p id="_c82e1988-2489-ef8c-438c-baefd450a833"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_ed65da86-4f60-321e-365f-9ada81601464"><p id="_3f95ed76-9a06-001f-9069-e7efdf3718b1"><tt>axes : list of ints (default is ['0', '2', '3'])</tt> — A list of integers, along which to reduce. The default is to calculate along axes [0,2,3] for calculating mean and variance along each channel. Two variables with the same C-coordinate are associated with the same mean and variance.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_cc930bb7-308d-c6b4-064c-59460c54b985"><p id="_5d587fa3-a743-bcee-f60e-cf6aab4aa2d5"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to all numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_3c0efead-418e-f4eb-7dd3-d24c938fc48b"><p id="_62d670e6-ad7c-012f-100f-5ee12bf48d1b"><tt>test_mvn</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_93d7ec06-b791-8169-10dd-1d8b9fb1714b"><p id="_4e5691c3-9170-e395-2676-002599e1f940">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_aa93489c-eee4-b4f2-7eac-6a99cf314466" anchor="op-ai-onnx-default-melweightmatrix" obligation="normative">
<title id="_c9c796b9-bad2-1c99-b0b5-5c08a605efb0">MelWeightMatrix</title>
<p id="_64716d83-06b2-7255-8415-be1ade1eec37">Generate a MelWeightMatrix that can be used to re-weight a Tensor containing a linearly sampled frequency spectra (from DFT or STFT) into num_mel_bins frequency information based on the [lower_edge_hertz, upper_edge_hertz] range on the mel scale. This function defines the mel scale in terms of a frequency in hertz according to the following formula:</p>

<sourcecode id="_e591f984-bfc0-ab5c-a733-dec8539d8b12" unnumbered="true"><body> mel(f) = 2595 * log10(1 + f/700)</body></sourcecode>


<p id="_7bcd9d0d-a68b-029e-022b-9733ba2c4a68">In the returned matrix, all the triangles (filterbanks) have a peak value of 1.0.</p>

<p id="_eaace822-0701-629c-dfcc-0286e481900e">The returned MelWeightMatrix can be used to right-multiply a spectrogram S of shape [frames, num_spectrogram_bins] of linear scale spectrum values (e.g. STFT magnitudes) to generate a “mel spectrogram” M of shape [frames, num_mel_bins].</p>

<dl id="_b50a0e49-001e-221f-d98e-dee08ea0be49"><dt>Domain</dt>
<dd id="_73b1feb4-e5e2-4018-5241-c7548cafe276"><p id="_131e7467-5547-f6fa-2972-db09a0fc8e12"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_43cff65e-8d4a-d7a5-e4be-02fa756bf9db"><p id="_f5f90993-7d49-1ff5-22be-bd44d3f291a3">17</p>
</dd>
<dt>Inputs</dt>
<dd id="_fc1584cd-ff8c-09c4-dcc0-de8c70e3ead3"><p id="_959bf7d2-46a5-aace-4a8a-175ac1e35c88"><tt>num_mel_bins (non-differentiable) : T1</tt> — The number of bands in the mel spectrum.<br/> <tt>dft_length (non-differentiable) : T1</tt> — The size of the original DFT. The size of the original DFT is used to infer the size of the onesided DFT, which is understood to be floor(dft_length/2) + 1, i.e. the spectrogram only contains the nonredundant DFT bins.<br/> <tt>sample_rate (non-differentiable) : T1</tt> — Samples per second of the input signal used to create the spectrogram. Used to figure out the frequencies corresponding to each spectrogram bin, which dictates how they are mapped into the mel scale.<br/> <tt>lower_edge_hertz (non-differentiable) : T2</tt> — Lower bound on the frequencies to be included in the mel spectrum. This corresponds to the lower edge of the lowest triangular band.<br/> <tt>upper_edge_hertz (non-differentiable) : T2</tt> — The desired top edge of the highest frequency band.</p>
</dd>
<dt>Outputs</dt>
<dd id="_b3634a6e-9cfa-023f-d46e-fc684d32b4d1"><p id="_32a81bf2-7022-eb1a-195f-a4c184c949ae"><tt>output (non-differentiable) : T3</tt> — The Mel Weight Matrix. The output has the shape: [floor(dft_length/2) + 1][num_mel_bins].</p>
</dd>
<dt>Attributes</dt>
<dd id="_c30b0cba-26e1-f33d-9ec0-a6bc9b0d0c4e"><p id="_e620cbd0-5720-93b2-33c7-7a353530abbd"><tt>output_datatype : int (default is 1)</tt> — The data type of the output tensor. Strictly must be one of the values from DataType enum in TensorProto whose values correspond to T3. The default value is 1 = FLOAT.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_a14a94d9-9911-c0de-39da-60f52e25200e"><p id="_b0ffc2bc-3d4e-b920-7c49-1d2faddbf33b"><tt>T1 : tensor(int32), tensor(int64)</tt> — Constrain to integer tensors.<br/> <tt>T2 : tensor(float), tensor(float16), tensor(double), tensor(bfloat16)</tt> — Constrain to float tensors<br/> <tt>T3 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain to any numerical types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_d1af822c-53dd-2b27-4516-bc6d3b247223"><p id="_5cee9528-7ba6-9bea-701a-bfe967a5653b"><tt>test_melweightmatrix</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_5faeea9e-7ba9-a7b2-70a2-278cfe67e10c"><p id="_f7f4cf69-fc7b-a4c7-7bc9-aebc65ddb761">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_98ccda71-9c63-de89-3251-d7c9adfde126" anchor="op-ai-onnx-default-min" obligation="normative">
<title id="_3e108500-af19-17a8-d9fd-2cf3b9773f39">Min</title>
<p id="_c1158d81-084b-5ca0-1274-6f6ce9f762c8">Element-wise min of each of the input tensors (with Numpy-style broadcasting support). All inputs and outputs must have the same data type. This operator supports  <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_b37a5b9b-80fe-02b3-5173-940b26eb71bc"><dt>Domain</dt>
<dd id="_4dd8a57e-8e1d-2b87-506d-22a0f5ffb286"><p id="_93be9b5b-2fbb-66b1-8ff7-336a7b6f3a71"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_867b05aa-a248-1b4d-967f-89253493eaa1"><p id="_1a849f34-5ae7-a330-d83f-c7670949b95e">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_2f3aa371-0063-14c7-bec2-7d257278ebfb"><p id="_87585503-1d74-7275-c66e-0f2c5ac42407">1, 6, 8, 12</p>
</dd>
<dt>Inputs (1 — unbounded)</dt>
<dd id="_6479c808-b055-b199-a0e2-a890e6320bf3"><p id="_984e4713-46c1-1f05-e797-d44830c416c5"><tt>data_0 (variadic, differentiable) : T</tt> — List of tensors for min.</p>
</dd>
<dt>Outputs</dt>
<dd id="_9dc04d4b-11f6-874a-9ad4-d51394c5e59c"><p id="_b99ec546-8735-37a1-7991-24b6dfa6b422"><tt>min (differentiable) : T</tt> — Output tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_b345bfc9-e76a-87b0-4625-15a1ce06f6bb"><p id="_64ad58fb-4016-3add-5c87-adf30b9289d9">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_5c7eebf5-deeb-788d-16c2-c543eb1fcf5d"><p id="_64b82ef7-1ce1-479c-6083-683116bfbe89"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_cbc619b2-fe10-d95b-2f7a-f80bcb73dfc0"><p id="_31e52064-4869-e0fc-d5c0-c32e301bc6e4"><tt>test_min_example</tt>, <tt>test_min_one_input</tt>, <tt>test_min_two_inputs</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_f7236a87-1c2a-826b-a16f-2ffc17976fd3"><p id="_32e25218-32a5-afed-c0d9-6038b4a9c7f0">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_07d6a0d1-3083-8dfa-2c4d-8bae1d7439c1" anchor="op-ai-onnx-default-mish" obligation="normative">
<title id="_3f0b69a6-c3b1-d74d-7741-84fadae1e176">Mish</title>
<p id="_2c4903cc-7bef-5050-5b53-4c226c99ee2a">Mish: A Self Regularized Non-Monotonic Neural Activation Function.</p>

<p id="_e2bae2b6-502f-4258-c011-c4dde0692da2">Perform the linear unit element-wise on the input tensor X using formula:</p>

<sourcecode id="_12daf485-4be3-fa66-9eab-e8b061957816" unnumbered="true"><body>mish(x) = x * tanh(softplus(x)) = x * tanh(ln(1 + e^{x}))</body></sourcecode>


<dl id="_e8a26e2f-1c8c-ad07-edf3-d99971bd21da"><dt>Domain</dt>
<dd id="_6815b354-a96e-b65a-a56f-346c59f4dd15"><p id="_5ab37eb2-0e62-d63b-b35f-1a057f104df3"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_c0066c7a-6428-5415-766a-30fe792e24f0"><p id="_7ce2e3ae-dc31-ae86-55a2-e60b1f778545">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_dce60f65-609d-586b-373b-d2a4969e87ff"><p id="_302b6965-c5c5-f787-41fd-fb92469afac0">18</p>
</dd>
<dt>Inputs</dt>
<dd id="_37bf9eaf-8d57-bc9a-7abc-8ad02000127b"><p id="_546a948e-e595-85a1-4c8b-b993906fa2a2"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_1de5070e-4643-0eff-a71c-b861ea3e5358"><p id="_875fd097-f228-bc90-a8ad-7775a7c8493d"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_a2951b8e-dbff-6562-a38b-46fd70cfb352"><p id="_d3a9f1da-672d-4706-460b-441bddb8f260">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_9097dec8-cce6-2bb7-4d22-7bd5d6c38b56"><p id="_fc46b60e-d729-2ce6-b0ba-d5f19b01b36c"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input X and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_b04640d2-a905-f919-b7a5-1eb196240db2"><p id="_23708813-82ba-70ac-42f4-4e1d8545f416"><tt>test_mish</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_d1963bb5-f1e8-e7e4-e515-4b771b635860"><p id="_017ead00-be8e-4f5f-30e4-9b597ea2ae13">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_1ff6b747-1aad-2404-f34f-981a6bb7706a" anchor="op-ai-onnx-default-mod" obligation="normative">
<title id="_ae85318a-e69d-0d42-9618-1a56a1922fd2">Mod</title>
<p id="_ff4040b3-cfdf-5ba4-2ae4-4c77ad9f16b7">Performs an element-wise binary modulo operation. The  <tt>fmod</tt> attribute determines how the quotient is rounded. Its value must be <tt>0</tt> (default) or <tt>1</tt>.</p>

<p id="_5a53579b-66b6-0e2f-da70-7c4cdabd67f4">If <tt>fmod</tt> is <tt>0</tt>, the output is calculated as <tt>A - floor(A / B) * B</tt>. The result has the same sign as  <tt>B</tt>. For floating-point inputs, the following special cases apply:</p>

<ul id="_4c06d701-3188-9bd4-99e3-360a9b5457ec"><li><p id="_80713e86-4625-01d4-d7a2-68208207f1ca">If <tt>x</tt> is <tt>±0</tt> and <tt>y</tt> is nonzero, <tt>±0</tt> with the sign of <tt>y</tt> is returned.</p>
</li>
<li><p id="_ebe066a1-1fce-bf4c-9e24-418b5eae90b1">If <tt>x</tt> is <tt>±∞</tt> and <tt>y</tt> is not <tt>NaN</tt>, <tt>NaN</tt> is returned.</p>
</li>
<li><p id="_7b2365c6-3479-167f-9092-c56466e3af8c">If <tt>y</tt> is <tt>±0</tt> and <tt>x</tt> is not <tt>NaN</tt>, <tt>NaN</tt> is returned.</p>
</li>
<li><p id="_48a8ba36-3bce-697e-8555-c82e455a6600">If <tt>y</tt> is <tt>±∞</tt> and <tt>x</tt> is finite and nonzero, <tt>x</tt> is returned when <tt>x</tt> and <tt>y</tt> have the same sign; otherwise, <tt>y</tt> is returned.</p>
</li>
<li><p id="_2ae148b5-87d3-b7ba-ad35-9245fb86ceec">If either argument is <tt>NaN</tt>, <tt>NaN</tt> is returned.</p>
</li>
</ul>

<p id="_4fffa8af-b4ed-68e4-a28f-48768594af59">If <tt>fmod</tt> is <tt>1</tt>, the output is calculated as <tt>A - trunc(A / B) * B</tt>. The result has the same sign as  <tt>A</tt>, except that either signed zero may be returned when  <tt>A</tt> is <tt>-0</tt> and <tt>B</tt> is positive. For floating-point inputs, the following special cases apply:</p>

<ul id="_e218ef0f-36a1-5517-d1e7-d6b68ed80e2b"><li><p id="_4dcff436-c97c-5050-d204-28ffa8c5e826">If <tt>x</tt> is <tt>-0</tt> and <tt>y</tt> is greater than zero, either <tt>+0</tt> or <tt>-0</tt> may be returned.</p>
</li>
<li><p id="_8ffe2bc1-bf17-4b3b-8dee-520442b4d600">If <tt>x</tt> is <tt>±∞</tt> and <tt>y</tt> is not <tt>NaN</tt>, <tt>NaN</tt> is returned.</p>
</li>
<li><p id="_835c00e1-5e22-6871-fe49-611f8d28e423">If <tt>y</tt> is <tt>±0</tt> and <tt>x</tt> is not <tt>NaN</tt>, <tt>NaN</tt> should be returned.</p>
</li>
<li><p id="_ffd44cb8-8737-f660-9aee-4ec30e0ac01f">If <tt>y</tt> is <tt>±∞</tt> and <tt>x</tt> is finite, <tt>x</tt> is returned.</p>
</li>
<li><p id="_5d511044-aed0-246d-de6d-276e2412fe90">If either argument is <tt>NaN</tt>, <tt>NaN</tt> is returned.</p>
</li>
</ul>

<p id="_749dd2e5-48ca-33a3-6ff8-661e19a111de">This operator supports <strong>multidirectional (i.e., NumPy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_82aa5589-7543-01c5-38c3-470f4592a47f"><dt>Domain</dt>
<dd id="_230efb00-5238-0161-1603-c4d008a81b67"><p id="_a537b38f-32e2-e3bf-f3ab-f88ced68f9e6"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_eab0d6a1-7344-6f14-8a74-2f89299814ef"><p id="_caa490f9-9971-805a-5af0-7a8b47f14305">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_8b54557c-11a4-51be-f1d2-b91925e382f6"><p id="_5eb5c389-58d8-b072-62c7-7bf732263efd">10, 13</p>
</dd>
<dt>Inputs</dt>
<dd id="_785ea9e3-2393-1ad0-189d-82210c8a6de7"><p id="_ebda989d-c255-1ebe-7ec8-ff3db354f20d"><tt>A (differentiable) : T</tt> — Dividend tensor<br/> <tt>B (non-differentiable) : T</tt> — Divisor tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_6cab09a8-4343-1277-e5a2-e377c91a00cc"><p id="_4c55e75b-7228-c3e9-35a4-f278d70edaa9"><tt>C (differentiable) : T</tt> — Remainder tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_1527bdbe-bac4-9830-9293-0f8c6685cf2a"><p id="_bc1724c4-c3b6-6c30-4313-3a180f141fcd"><tt>fmod : int (default is 0)</tt> — Whether the operator should use floor (0) or truncation (1) to calculate the quotient.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_52b2287d-9c9f-9131-c613-6d4bcc8aee54"><p id="_5f6cd1f9-b1b9-8b93-fd1d-d91ef6921875"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_a332c2c4-361b-e647-8118-d116d0f1172f"><p id="_9dbc85cb-5707-709f-3559-9744c41aa3e9"><tt>test_mod_broadcast</tt>, <tt>test_mod_int64_fmod</tt>, <tt>test_mod_mixed_sign_float16</tt>, <tt>test_mod_float16_mixed_sign_fmod_0</tt>, <tt>test_mod_mixed_sign_float32</tt>, <tt>test_mod_float32_mixed_sign_fmod_0</tt>, <tt>test_mod_mixed_sign_float64</tt>, <tt>test_mod_float64_mixed_sign_fmod_0</tt>, <tt>test_mod_mixed_sign_int16</tt>, <tt>test_mod_mixed_sign_int32</tt>, <tt>test_mod_mixed_sign_int64</tt>, <tt>test_mod_mixed_sign_int8</tt>, <tt>test_mod_uint16</tt>, <tt>test_mod_uint32</tt>, <tt>test_mod_uint64</tt>, <tt>test_mod_uint8</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_b7b63b13-ef3f-b5bb-28db-c399239a6c4b"><p id="_0798284d-8d40-7d64-84ba-632bff716c17">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_9ce24d21-f84c-744a-dafb-2f2f9545674a" anchor="op-ai-onnx-default-mul" obligation="normative">
<title id="_2d5c378b-3581-148e-2d30-ab363272b918">Mul</title>
<p id="_198102b6-8e89-9db2-c200-d3cbda8fdcf5">Performs element-wise binary multiplication (with Numpy-style broadcasting support).</p>

<p id="_739054e9-6937-cb75-b60f-16e18bfecfc7">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<p id="_b356490e-fff9-a954-f938-f5026c467261">(Opset 14 change): Extend supported types to include uint8, int8, uint16, and int16.</p>

<dl id="_a69238e8-e823-38c5-1e3e-51041e5fa7d6"><dt>Domain</dt>
<dd id="_7c03e1a5-46e0-a55e-f04a-ad4381a32470"><p id="_8497ef79-0dbe-8d2d-51c8-952b773e7d48"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_55e89554-93f6-a1fd-7ac2-9918e6215dea"><p id="_18107f85-dce2-b2a5-c222-7f71a5544c5a">14</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_ffd1d287-b5c8-1d72-b99a-4b34360be36d"><p id="_f3fbf777-7fba-92af-ac2a-bd11db4d018b">1, 6, 7, 13</p>
</dd>
<dt>Inputs</dt>
<dd id="_ece4b413-cda7-a32e-cc21-a270f18fa344"><p id="_b0eb5447-68ef-d988-8070-3986b248098d"><tt>A (differentiable) : T</tt> — First operand.<br/> <tt>B (differentiable) : T</tt> — Second operand.</p>
</dd>
<dt>Outputs</dt>
<dd id="_2ab9d879-db74-6a2c-ccd7-e251bf9e5bd8"><p id="_42b54c31-362b-49e9-0589-8f76716b4177"><tt>C (differentiable) : T</tt> — Result, has same element type as two inputs</p>
</dd>
<dt>Attributes</dt>
<dd id="_d8e69e24-bb79-7b92-0411-d75940471ae6"><p id="_1afd6a0c-38a9-0fe5-814b-d65ca7b5aa35">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_4c112354-39b6-c21f-e553-014623654e6e"><p id="_9ea6fdea-20d5-3131-2b3c-a01f1f3e9fc7"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to all numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_28b658de-e1f3-33fc-fbb4-25ec79127a0b"><p id="_204cb3f2-8acf-ba90-23f8-1bee3132ac92"><tt>test_mul_example</tt>, <tt>test_mul</tt>, <tt>test_mul_int8</tt>, <tt>test_mul_int16</tt>, <tt>test_mul_uint8</tt>, <tt>test_mul_uint16</tt>, <tt>test_mul_uint32</tt>, <tt>test_mul_uint64</tt>, <tt>test_mul_bcast</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_a3b091d1-32da-9077-fd88-7ad75bbb628a"><p id="_f35bdecd-4020-5c59-c8ce-432b34d2cb41">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_95c11677-8e5d-6be3-8fec-988c11cd48e4" anchor="op-ai-onnx-default-multinomial" obligation="normative">
<title id="_74b74398-b0da-0057-33c9-efdbe9052260">Multinomial</title>
<p id="_9a875774-e618-95dd-d5bb-0eff99a6dafc">Generate a tensor of samples from a multinomial distribution according to the probabilities of each of the possible outcomes.</p>

<dl id="_7ba04546-f75d-1424-7cfd-a7de4165c4ab"><dt>Domain</dt>
<dd id="_78457b83-4d88-abc7-a0d3-55f4cf11229a"><p id="_d439d1e3-699d-0264-5602-2bbda58b65a7"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_8082ca6b-0b22-fcff-9ffd-125c363c3478"><p id="_b0584556-dc3c-91d1-57a0-5fd072581795">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_a4968cd5-40c3-e338-ea69-93e0e275ca20"><p id="_e8ed0df0-1a34-ed81-741e-8b9c8b34777e">7</p>
</dd>
<dt>Inputs</dt>
<dd id="_7f952130-4c9f-a76e-50e3-598a4fa5385f"><p id="_cf920510-fab5-e6c0-40ff-0de2f3e7fc17"><tt>input : T1</tt> — Input tensor with shape [batch_size, class_size], where class_size is the number of all possible outcomes. Each value along the axis zero represents the unnormalized log-probability of each corresponding outcome in a batch.</p>
</dd>
<dt>Outputs</dt>
<dd id="_38b382fa-54de-8f32-98e5-9c7726048fa0"><p id="_b6258226-dd8c-33a4-f2ff-67656551fb0e"><tt>output : T2</tt> — Output tensor with shape [batch_size, sample_size], where sample_size is the number of times to sample. Each value along the axis zero represents the outcome of the corresponding sample in a batch.</p>
</dd>
<dt>Attributes</dt>
<dd id="_4cca2ff9-5d2b-20ac-a321-ad8a6d4a53ed"><p id="_af9d6ec1-b710-59b6-b149-31d2fe966ca7"><tt>dtype : int (default is 6)</tt> — (Optional) The data type for the elements of the output tensor, if not specified, we will use int32.<br/> <tt>sample_size : int (default is 1)</tt> — Number of times to sample.<br/> <tt>seed : float</tt> — (Optional) Seed to the random generator, if not specified we will auto generate one.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_5becaf79-ea31-4c18-1a12-2c490c36e7e4"><p id="_1ccbcc04-18bc-c95e-1099-1db5db461c3f"><tt>T1 : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input types to float tensors.<br/> <tt>T2 : tensor(int32), tensor(int64)</tt> — Constrain output types to integral tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_2d4a5cf6-69db-8e01-3347-7e341d76e976"><p id="_446b9b3a-d025-eda6-b577-6c5f661692d3">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_e71ec9fc-bf45-6684-bfe1-e53c062dc10b"><p id="_56691d0a-4a97-620d-a2d8-3b2ae922a79a">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_59ebc55a-8016-ea03-c5e1-47d0fdd525fa" anchor="op-ai-onnx-default-neg" obligation="normative">
<title id="_20ec532d-cc10-778e-c170-f6b1e408790c">Neg</title>
<p id="_2d106e99-a2c2-737f-2bbb-f02034e50e93">Neg takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where each element flipped sign, y = -x, is applied to the tensor elementwise.</p>

<dl id="_eb6bad92-598e-0efb-61d4-2a8a89d4683b"><dt>Domain</dt>
<dd id="_09eb3214-aa99-caaf-e4f6-03f90c183581"><p id="_203b25d4-60ca-6ea8-405b-8a145f5188c6"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_d4865359-668b-3e29-923f-8c661dc67b8f"><p id="_6921b14b-823c-6ab7-892e-942b38869667">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_ac628aa6-6600-8dac-e012-d15059c7c25c"><p id="_2fb3cb92-c047-cd42-dd16-aa4564f4cc19">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_022e200d-da76-4b53-7298-70cfc8670b12"><p id="_c2dde431-2107-28a7-4f2a-749169cddc0a"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_ca7c1f44-ddc2-7cdd-cbdf-a5bae2160870"><p id="_1d5b7cd6-25f4-bd05-e574-d9f937187a7e"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_6ff6355b-e8d6-9e91-3f76-8523a92b2371"><p id="_fdef3181-a9e2-a204-a06e-07aec6a45905">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_8efdccd5-74a4-89e3-233f-c5fb86ef25ec"><p id="_a276261d-db8c-e12f-4055-232783b23aed"><tt>T : tensor(float), tensor(int32), tensor(int8), tensor(int16), tensor(int64), tensor(float16), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to signed numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_3bacfd12-9d3a-7165-0211-b550eaa03556"><p id="_9c950d3b-72c9-6582-3fdc-75257c6107d8"><tt>test_neg_example</tt>, <tt>test_neg</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_903bba5f-75a9-7478-3f4b-1cc2a7c27e97"><p id="_220cffbd-6a3c-ed4a-60bd-f554cc3c3146">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_fe4fb85b-02c1-c376-090b-3de3a21db476" anchor="op-ai-onnx-default-negativeloglikelihoodloss" obligation="normative">
<title id="_30a37e20-91f6-f238-9c32-9e8e5cf12263">NegativeLogLikelihoodLoss</title>
<p id="_79efe52b-2dfe-13cd-640f-1ca88a3cc761">A NegativeLogLikelihoodLoss operator computes (weighted) negative log likelihood loss. Its “input” tensor has the shape of (N, C, d1, d2, …​, dk) where k &gt;= 0. The “input” tensor contains log-probabilities for input[n, :, d_1, d_2,…​, d_k] being in a class of [0, C). The operator’s “target” input tensor has the shape of (N, d1, d2, …​, dk). It encodes class labels (one of C classes) or it may contain a special value (indicated by an attribute ignore_index) for N x d1 x d2 x …​ x dk samples. The loss value for input[n, :, d_1, d_2,…​d_k] being classified as class c = target[n][d_1][d_2]…​[d_k] is computed as:</p>

<sourcecode id="_8cbaa429-1303-54d8-6154-9f189aa63558" unnumbered="true"><body>loss[n][d_1][d_2]...[d_k] = -input[n][c][d_1][d_2]...[d_k].</body></sourcecode>


<p id="_1770c771-fa49-9455-a334-d356360d0116">When an optional “weight” is provided, the sample loss is calculated as:</p>

<sourcecode id="_7f82b27d-991d-c91d-d7da-cc2156ee2dbb" unnumbered="true"><body>loss[n][d_1][d_2]...[d_k] = -input[n][c][d_1][d_2]...[d_k] * weight[c].</body></sourcecode>


<p id="_620b1781-2126-63ba-891b-106dfab16a42">loss is zero for the case when target-value equals ignore_index.</p>

<sourcecode id="_d51c5529-5fe8-53b6-5060-a6cec2da0d9f" unnumbered="true"><body>loss[n][d_1][d_2]...[d_k] = 0, when target[n][d_1][d_2]...[d_k] = ignore_index</body></sourcecode>


<p id="_74b7b885-bb26-31aa-0f27-e8d42bf4b1bb">If “reduction” attribute is set to “none”, the operator’s output will be the above loss with shape (N, d1, d2, …​, dk). If “reduction” attribute is set to “mean” (the default attribute value), the output loss is (weight) averaged:</p>

<sourcecode id="_03f048da-b38d-0f60-0209-3e1ab7a12ffe" unnumbered="true"><body>mean(loss), if "weight" is not provided,</body></sourcecode>


<p id="_15f9de16-56f9-7a97-6ed7-103524718496">or if weight is provided,</p>

<sourcecode id="_b54aa6ba-5f5a-7250-05e0-82b22a83d8a2" unnumbered="true"><body>sum(loss) / sum(weight[target[n][d_1][d_2]...[d_k]]]), for all samples.</body></sourcecode>


<p id="_8dabf4b6-8e70-3607-91bf-334ba56c9bdd">If “reduction” attribute is set to “sum”, the output is a scalar: <tt>sum(loss)</tt>.</p>

<p id="_2ecc0bbd-e89e-8e7f-4cd9-7990bd3937ec">See also <link target="https://pytorch.org/docs/stable/nn.html#torch.nn.NLLLoss"/>.</p>

<p id="_aeb6ef2f-f774-e6b7-d645-83de8378be17">Example 1:</p>

<sourcecode id="_d87f536f-c7c6-bedb-a9f1-123a79064ef5" unnumbered="true"><body>// negative log likelihood loss, "none" reduction
N, C, d1 = 2, 3, 2
input = [[[1.0, 2.0], [2.0, 2.0], [3.0, 2.0]],
          [[0.0, 1.0], [2.0, 2.0], [1.0, 2]]]
target = [[2, 1], [0, 2]]

loss = np.zeros((N, d1))
for n in range(N):
    for d_1 in range(d1):
        c = target[n][d_1]
        loss[n][d_1] = -input[n][c][d_1]

// print(loss)
// [[-3. -2.]
//  [-0. -2.]]</body></sourcecode>


<p id="_3442e5eb-7649-0f39-aa31-545099c5bf32">Example 2:</p>

<sourcecode id="_f071f9ad-f193-ee3f-b928-3b65a1cbb93a" unnumbered="true"><body>// weighted negative log likelihood loss, sum reduction
N, C, d1 = 2, 3, 2
input = [[[1.0, 2.0], [2.0, 2.0], [3.0, 2.0]],
        [[0.0, 1.0], [2.0, 2.0], [1.0, 2]]]
target = [[2, 1], [0, 2]]
weight = [0.2, 0.3, 0.1]
loss = np.zeros((N, d1))
for n in range(N):
    for d_1 in range(d1):
        c = target[n][d_1]
        loss[n][d_1] = -input[n][c][d_1] * weight[c]

loss = np.sum(loss)
// print(loss)
// -1.1</body></sourcecode>


<p id="_37774168-adc2-ac3a-00d6-f1c6e9945dd5">Example 3:</p>

<sourcecode id="_8528106c-6fbd-aafa-6bdf-f2756a84b3df" unnumbered="true"><body>// weighted negative log likelihood loss, mean reduction
N, C, d1 = 2, 3, 2
input = [[[1.0, 2.0], [2.0, 2.0], [3.0, 2.0]],
        [[0.0, 1.0], [2.0, 2.0], [1.0, 2]]]
target = [[2, 1], [0, 2]]
weight = [0.2, 0.3, 0.1]
loss = np.zeros((N, d1))
weight_total = 0
for n in range(N):
    for d_1 in range(d1):
        c = target[n][d_1]
        loss[n][d_1] = -input[n][c][d_1] * weight[c]
        weight_total = weight_total + weight[c]

loss = np.sum(loss) / weight_total
// print(loss)
// -1.57</body></sourcecode>


<dl id="_02ebb5bc-a454-07d8-1c41-e421ff3a1dc6"><dt>Domain</dt>
<dd id="_cf4a7d21-56a8-69f0-8560-6ccbee91f126"><p id="_ab45ebfd-c72e-40ab-bbf9-02daff97679f"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_f374c75b-9e0e-8971-ddac-a4d688e056e1"><p id="_9f7a2dd6-7053-9707-531f-7b9c49d4cfee">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_6280828b-48f2-7e0b-b63a-39a47ab094eb"><p id="_bc47d838-17bd-cc64-4a3c-4082c85dbae5">12, 13</p>
</dd>
<dt>Inputs (2 — 3)</dt>
<dd id="_638ac9e4-dd33-895b-d1ab-cfc0951d1183"><p id="_4d875680-a4ba-8b89-5f0e-5716363610e8"><tt>input (differentiable) : T</tt> — Input tensor of shape (N, C) or (N, C, d1, d2, …​, dk).<br/> <tt>target (non-differentiable) : Tind</tt> — Target tensor of shape (N) or (N, d1, d2, …​, dk). Target element value shall be in range of [0, C). If ignore_index is specified, it may have a value outside [0, C) and the target values should either be in the range [0, C) or have the value ignore_index.<br/> <tt>weight (optional, non-differentiable) : T</tt> — Optional rescaling weight tensor. If given, it has to be a tensor of size C. Otherwise, it is treated as if having all ones.</p>
</dd>
<dt>Outputs</dt>
<dd id="_4c5d1a6a-a1d4-2ab5-051a-26fc2ce56f4b"><p id="_d4f3b7c1-143b-7662-8cd2-d50decdd642e"><tt>loss (differentiable) : T</tt> — The negative log likelihood loss</p>
</dd>
<dt>Attributes</dt>
<dd id="_8b820286-2d98-623c-e3da-54d36dc7a44d"><p id="_074ead4b-461e-5e50-509b-f69e7b0119aa"><tt>ignore_index : int</tt> — Specifies a target value that is ignored and does not contribute to the input gradient. It’s an optional value.<br/> <tt>reduction : string (default is mean)</tt> — Type of reduction to apply to loss: none, sum, mean (default). ‘none’: the output is the loss for each sample. ‘sum’: the output will be summed. ‘mean’: the sum of the output will be divided by the sum of applied weights.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_0307bb74-c220-84a5-b156-755257c9431a"><p id="_04452347-3672-f8d7-d34b-21cc5ce0ba2d"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input, weight, and output types to floating-point tensors.<br/> <tt>Tind : tensor(int32), tensor(int64)</tt> — Constrain target to integer types</p>
</dd>
<dt>Test vectors</dt>
<dd id="_eff8eb43-07b2-e689-b59f-d195b3e679d6"><p id="_dae09367-14ed-d2fa-2f16-4e697965c256"><tt>test_nllloss_NC</tt>, <tt>test_nllloss_NCd1</tt>, <tt>test_nllloss_NCd1_ii</tt>, <tt>test_nllloss_NCd1_mean_weight_negative_ii</tt>, <tt>test_nllloss_NCd1_weight</tt>, <tt>test_nllloss_NCd1_weight_ii</tt>, <tt>test_nllloss_NCd1d2</tt>, <tt>test_nllloss_NCd1d2_no_weight_reduction_mean_ii</tt>, <tt>test_nllloss_NCd1d2_reduction_mean</tt>, <tt>test_nllloss_NCd1d2_reduction_sum</tt>, <tt>test_nllloss_NCd1d2_with_weight</tt>, <tt>test_nllloss_NCd1d2_with_weight_reduction_mean</tt>, <tt>test_nllloss_NCd1d2_with_weight_reduction_sum</tt>, <tt>test_nllloss_NCd1d2_with_weight_reduction_sum_ii</tt>, <tt>test_nllloss_NCd1d2d3_none_no_weight_negative_ii</tt>, <tt>test_nllloss_NCd1d2d3_sum_weight_high_ii</tt>, <tt>test_nllloss_NCd1d2d3d4d5_mean_weight</tt>, <tt>test_nllloss_NCd1d2d3d4d5_none_no_weight</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_eacfedb3-8489-d6af-2505-bfa1c7d2d71d"><p id="_0a1eb199-b757-5e11-6842-e1ef754b6e7b">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_819a6122-862b-5d96-490f-92c86a17f3b9" anchor="op-ai-onnx-default-nonmaxsuppression" obligation="normative">
<title id="_e3e1a37a-306a-4b18-7585-a3a6571e39a7">NonMaxSuppression</title>
<p id="_62e7c9bc-65a5-20c7-c7dd-7810bd63d759">Filter out boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes with score less than score_threshold are removed. Bounding box format is indicated by attribute center_point_box. Boxes are suppressed if their IOU with a previously selected box is strictly greater than iou_threshold (i.e., boxes with IOU exactly equal to the threshold are kept). Note that this algorithm is agnostic to where the origin is in the coordinate system and more generally is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm. The selected_indices output is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the Gather or GatherND operation.</p>

<dl id="_58e5375e-b41d-ab63-9d7c-db7717e62797"><dt>Domain</dt>
<dd id="_baccfc92-8012-fcba-98d2-fa1c456c2b7b"><p id="_f65336d3-9cc6-807a-9700-327ac5b0620b"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_e94216a3-8f30-8c8f-ed49-a6cc32281a96"><p id="_74d808d9-9bb5-4c1e-a0ea-d14e9aeecc18">11</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_b796f5ff-16ab-7b75-3329-ca893644db32"><p id="_23d35b67-bb8d-b2f5-548d-0770047996df">10</p>
</dd>
<dt>Inputs (2 — 5)</dt>
<dd id="_9e31e52d-35de-da61-681e-5ae2ce8a9c3c"><p id="_4840790d-24ce-e7f2-3db1-987e18abd124"><tt>boxes : tensor(float)</tt> — An input tensor with shape [num_batches, spatial_dimension, 4]. The single box data format is indicated by center_point_box.<br/> <tt>scores : tensor(float)</tt> — An input tensor with shape [num_batches, num_classes, spatial_dimension]<br/> <tt>max_output_boxes_per_class (optional) : tensor(int64)</tt> — Integer representing the maximum number of boxes to be selected per batch per class. It is a scalar. Default to 0, which means no output.<br/> <tt>iou_threshold (optional) : tensor(float)</tt> — Float representing the threshold for deciding whether boxes overlap too much with respect to IOU. Boxes with IoU strictly greater than this threshold are suppressed. It is scalar. Value range [0, 1]. Default to 0.<br/> <tt>score_threshold (optional) : tensor(float)</tt> — Float representing the threshold for deciding when to remove boxes based on score. It is a scalar.</p>
</dd>
<dt>Outputs</dt>
<dd id="_e99c3311-e1b3-b5f6-e592-36e242339f35"><p id="_8778d278-8ffb-bc97-bdc2-bd3fb7161e53"><tt>selected_indices : tensor(int64)</tt> — selected indices from the boxes tensor. [num_selected_indices, 3], the selected index format is [batch_index, class_index, box_index].</p>
</dd>
<dt>Attributes</dt>
<dd id="_20e19bbe-db07-3ec3-18f4-9a9d976ca9ae"><p id="_a3bdffd9-3963-e29a-120e-e0cb55f0c499"><tt>center_point_box : int (default is 0)</tt> — Integer indicate the format of the box data. The default is 0. 0 — the box data is supplied as [y1, x1, y2, x2] where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval [0, 1]) or absolute. Mostly used for TF models. 1 — the box data is supplied as [x_center, y_center, width, height]. Mostly used for Pytorch models.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_29a26433-a5fe-a46f-f28c-3f879e5184d4"><p id="_98f15b32-2b7d-932f-8a0c-45b7e7329b62">None.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_1e47fbf7-eff5-24d5-79d5-ee4a4def53e0"><p id="_fe512af4-ca6d-f7b6-a716-d1f596cb40a2"><tt>test_nonmaxsuppression_center_point_box_format</tt>, <tt>test_nonmaxsuppression_flipped_coordinates</tt>, <tt>test_nonmaxsuppression_identical_boxes</tt>, <tt>test_nonmaxsuppression_iou_threshold_boundary</tt>, <tt>test_nonmaxsuppression_limit_output_size</tt>, <tt>test_nonmaxsuppression_single_box</tt>, <tt>test_nonmaxsuppression_suppress_by_IOU</tt>, <tt>test_nonmaxsuppression_suppress_by_IOU_and_scores</tt>, <tt>test_nonmaxsuppression_two_batches</tt>, <tt>test_nonmaxsuppression_two_classes</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_3bbf2a62-af25-4aa6-b192-5a07c85b33cc"><p id="_b1073ce1-61f3-9475-408f-086b6412194f">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_04c2442c-2608-2a02-0ec1-02720d530de6" anchor="op-ai-onnx-default-nonzero" obligation="normative">
<title id="_b1a55071-a1dc-db8e-184e-fa3edd26d88e">NonZero</title>
<p id="_8d97e3c6-6274-e4f3-0428-0c9d46407cb7">Returns the indices of the elements that are non-zero     (in row-major order — by dimension).     NonZero behaves similar to numpy.nonzero:      <link target="https://docs.scipy.org/doc/numpy/reference/generated/numpy.nonzero.html"/>,     but for scalar input, NonZero produces output shape (0, N) instead of (1, N), which is different from Numpy’s behavior.</p>

<dl id="_738fbce2-7ec0-434e-f0eb-e32087ae9949"><dt>Domain</dt>
<dd id="_f58c3a63-bfaa-231c-2035-19313ee2ab36"><p id="_415e9339-1b05-d07d-94d9-627346b2e0a5"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_da3f596f-291d-08b7-994e-f56c1f9f9200"><p id="_ea00e255-e267-a216-6893-121344fa377d">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_e3a4fed7-aa64-6e0b-0014-8ac974e23f10"><p id="_bedecc4d-d1cd-1f5f-b511-ff39ac713d32">9</p>
</dd>
<dt>Inputs</dt>
<dd id="_2ca044ff-5a9c-99e0-53be-418082b3ca86"><p id="_58086a15-0b54-cba0-6975-885c2bc5a169"><tt>X (non-differentiable) : T</tt> — input</p>
</dd>
<dt>Outputs</dt>
<dd id="_c746134e-e9f5-0754-731d-74ddf9a4ccfb"><p id="_c53f2fd9-0210-93c5-a9d5-b3dd367a141d"><tt>Y (non-differentiable) : tensor(int64)</tt> — output</p>
</dd>
<dt>Attributes</dt>
<dd id="_905d9455-3144-40fd-31c0-71cc9be2e0f2"><p id="_0f9ebc43-612f-1887-9d9d-1c8422a64b5c">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_809c61c1-ceb2-f651-0cf6-eaaa8f20456e"><p id="_f04f8423-edd7-d01c-5f8e-9f2660e6feae"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain to all tensor types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_40cac773-0f62-eb8b-1146-214765747c1b"><p id="_77c25ee6-7e7a-6e51-91b9-11adf0245568"><tt>test_nonzero_example</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_a525b3ca-ca02-5981-e5a2-12d6e470732c"><p id="_906f4c67-2d0a-e658-3ae3-29fb2ce9cbc9">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_b3e6b16c-78b7-5baf-2c5f-ec291f09a91e" anchor="op-ai-onnx-default-not" obligation="normative">
<title id="_70713e7e-3ead-1efb-5d9c-5ca29e185d54">Not</title>
<p id="_4490231b-bb03-4294-8171-22d5e40cdd38">Returns the negation of the input tensor element-wise.</p>

<dl id="_30c4d8c0-a263-9880-0efc-b7a90f16c3d6"><dt>Domain</dt>
<dd id="_a17b8774-62f4-6029-5d67-d70a303c950c"><p id="_766b4409-19d8-351b-f4ac-afe2244b0165"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_d09adcbd-e01c-8bba-aa2c-e277a521e235"><p id="_a571a5e6-c12b-5bab-d323-46c280f32ee4">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_c209740c-897b-338d-dd18-2e7bfc1e0681"><p id="_73399e08-99a8-e946-3a4b-423f6c122882"><tt>X (non-differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_907c0e7e-7353-e767-cc89-feb786e994e6"><p id="_a3e7f09b-f0f0-05e5-0444-afb8d20846d6"><tt>Y (non-differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_2e2a72ef-da46-5561-d5c9-56c3b5d0f1e5"><p id="_e904b7b0-85d4-4021-d0d0-36bc22a5b4d2">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_00eb3fdb-a188-196a-0bff-ad2a68fa485c"><p id="_c897ac4d-6623-aaff-06be-8e8e45de1ce4"><tt>T : tensor(bool)</tt> — Constrain input/output to boolean tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_d4b70051-6a45-5b3d-4f8e-fb99582ba01b"><p id="_5bfd6349-ba72-982f-345a-356ceabc19bf"><tt>test_not_2d</tt>, <tt>test_not_3d</tt>, <tt>test_not_4d</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_baf5b4cb-daba-b666-3eb9-4bcddb739c12"><p id="_7eecc25d-7750-7ca2-1212-a0d0e509db8b">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_1781a4d7-03bb-449c-6b65-c9e541db1575" anchor="op-ai-onnx-default-onehot" obligation="normative">
<title id="_621b531d-8a9c-c8a6-c1d7-7a601251c13e">OneHot</title>
<p id="_880e5f78-2573-a3fc-4e65-2b3e81adc423">Produces a one-hot tensor based on inputs.     The locations represented by the index values in the ‘indices’ input tensor will have ‘on_value’     and the other locations will have ‘off_value’ in the output tensor, where ‘on_value’ and ‘off_value’     are specified as part of required input argument ‘values’, which is a two-element tensor of format     [off_value, on_value]. The rank of the output tensor will be one greater than the rank of the     input tensor. The additional dimension is for one-hot representation. The additional dimension will     be inserted at the position specified by ‘axis’. If ‘axis’ is not specified then the additional     dimension will be inserted as the innermost dimension, i.e. axis=-1. The size of the additional     dimension is specified by required scalar input ‘depth’. The type of the output tensor is the same     as the type of the ‘values’ input. Any entries in the ‘indices’ input tensor with values outside     the range [-depth, depth-1] will result in one-hot representation with all ‘off_value’ values in the     output tensor.</p>

<sourcecode id="_ef0cfa65-5968-9385-cef9-81be12961b3e" unnumbered="true"><body>when axis = 0:
output[input[i, j, k], i, j, k] = 1 for all i, j, k and 0 otherwise.

when axis = -1:
output[i, j, k, input[i, j, k]] = 1 for all i, j, k and 0 otherwise.</body></sourcecode>


<dl id="_34ffc91d-42fb-905e-46bf-0208b960348d"><dt>Domain</dt>
<dd id="_56156a32-c24b-6af5-93a7-550de0acdf25"><p id="_1a40756f-11e4-3f95-c1ee-a0d197d2fd6e"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_58ccb5d7-d335-5655-76b5-de1fdeaa33b1"><p id="_acbbbb89-34f4-e8a8-295a-e929094681e7">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_166ea26b-a38a-3b09-4526-ee68b6b750bf"><p id="_bd5bb7cb-47f7-93f9-8345-67fbbe1f6e2c">9, 11</p>
</dd>
<dt>Inputs</dt>
<dd id="_39a860ce-3134-1970-8229-50d26ca0500e"><p id="_855cc946-dc02-e6f3-3362-cbdb074413f7"><tt>indices (non-differentiable) : T1</tt> — Input tensor containing indices. Any entries in the ‘indices’ input tensor with values outside the range [-depth, depth-1] will result in one-hot representation with all ‘off_value’ values in the output tensor.In case ‘indices’ is of non-integer type, the values will be casted to int64 before use.<br/> <tt>depth (non-differentiable) : T2</tt> — Scalar or Rank 1 tensor containing exactly one element, specifying the number of classes in one-hot tensor. This is also the size of the one-hot dimension (specified by ‘axis’ attribute) added on in the output tensor. The values in the ‘indices’ input tensor are expected to be in the range [-depth, depth-1]. In case ‘depth’ is of non-integer type, it will be casted to int64 before use.<br/> <tt>values (non-differentiable) : T3</tt> — Rank 1 tensor containing exactly two elements, in the format [off_value, on_value], where ‘on_value’ is the value used for filling locations specified in ‘indices’ input tensor, and ‘off_value’ is the value used for filling locations other than those specified in ‘indices’ input tensor.</p>
</dd>
<dt>Outputs</dt>
<dd id="_d07d2211-4f00-e042-601b-eeeb4fb5e8dc"><p id="_f15a9ad8-c2e5-d114-a49e-0373fbb0d697"><tt>output (non-differentiable) : T3</tt> — Tensor of rank one greater than input tensor ‘indices’, i.e. rank(output) = rank(indices) + 1. The data type for the elements of the output tensor is the same as the type of input ‘values’ is used.</p>
</dd>
<dt>Attributes</dt>
<dd id="_08ed6211-88be-d06a-a380-8060df47dac7"><p id="_1f303e5f-e0cb-23a2-c7d6-056c3a71a81e"><tt>axis : int (default is -1)</tt> — (Optional) Axis along which one-hot representation in added. Default: axis=-1. axis=-1 means that the additional dimension will be inserted as the innermost/last dimension in the output tensor. Negative value means counting dimensions from the back. Accepted range is [-r-1, r] where r = rank(indices).</p>
</dd>
<dt>Type constraints</dt>
<dd id="_bedf3d66-3640-d77a-a53f-e95b2b602fb9"><p id="_2383c2b1-f8cb-6ab6-b63c-8aa37f4faa5d"><tt>T1 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input to only numeric types.<br/> <tt>T2 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input to only numeric types.<br/> <tt>T3 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain to any tensor type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_213cf96b-1e79-5e84-49a5-98f5eed532f7"><p id="_2eb14538-dafc-7f47-adba-a266b829e956"><tt>test_onehot_with_axis</tt>, <tt>test_onehot_with_bfloat16_values</tt>, <tt>test_onehot_with_negative_axis</tt>, <tt>test_onehot_negative_indices</tt>, <tt>test_onehot_out_of_range_indices</tt>, <tt>test_onehot_without_axis</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_25ec9e7c-9c01-5884-ae57-2f32b155bd9d"><p id="_d9e163a0-8c3f-078f-f1ba-e08544a9afe4">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_6b1336d1-265f-1507-d352-a4980a8bb7a5" anchor="op-ai-onnx-default-optional" obligation="normative">
<title id="_37b0adba-acca-3240-ad5c-0e50add79e64">Optional</title>
<p id="_8d5c66ef-f88e-8fca-1ce0-5bc9cdd88efc">Constructs an optional-type value containing either an empty optional of a certain type specified by the attribute, or a non-empty value containing the input element.</p>

<dl id="_dad91c7c-2fdf-ba15-9a95-76d341ceff4f"><dt>Domain</dt>
<dd id="_d71d6ddb-a0eb-7824-9f7d-322c315f546a"><p id="_153a2625-4467-39aa-4d1c-c0d9b8296f40"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_20315d04-ad09-031e-90a7-33df1167f4f0"><p id="_1be9136c-3045-aede-5bf0-3d33f33161a0">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_3512f384-e32a-88e0-1260-b42e0c1c9645"><p id="_777bbbc8-e559-eed1-cf5a-094b901d67f2">15</p>
</dd>
<dt>Inputs (0 — 1)</dt>
<dd id="_2521da76-ef20-4850-66ba-c2e8b7056a8e"><p id="_63cb70ba-7c0d-623d-c519-ca0149b53779"><tt>input (optional) : V</tt> — The input element.</p>
</dd>
<dt>Outputs</dt>
<dd id="_5709359b-46fc-88d4-68d8-ffa9db207a19"><p id="_8cc0c52c-931d-76a2-8251-68661f626d2a"><tt>output : O</tt> — The optional output enclosing the input element.</p>
</dd>
<dt>Attributes</dt>
<dd id="_bcfe6351-c2c1-a047-5091-0e5c75caad64"><p id="_c7c71e71-629e-e3a6-3cea-955baf71cf40"><tt>type : type_proto</tt> — Type of the element in the optional output</p>
</dd>
<dt>Type constraints</dt>
<dd id="_f24e9895-8578-dfeb-2aeb-0e75f8d30a4a"><p id="_ef07f877-f8e4-7f70-e3e1-03a9bbda04f0"><tt>V : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2), tensor(float6e2m3), tensor(float6e3m2), seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(bfloat16)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128)), seq(tensor(float8e4m3fn)), seq(tensor(float8e4m3fnuz)), seq(tensor(float8e5m2)), seq(tensor(float8e5m2fnuz)), seq(tensor(uint4)), seq(tensor(int4)), seq(tensor(float4e2m1)), seq(tensor(float8e8m0)), seq(tensor(uint2)), seq(tensor(int2)), seq(tensor(float6e2m3)), seq(tensor(float6e3m2))</tt> — Constrain input type to all tensor and sequence types.<br/> <tt>O : optional(tensor(uint8)), optional(tensor(uint16)), optional(tensor(uint32)), optional(tensor(uint64)), optional(tensor(int8)), optional(tensor(int16)), optional(tensor(int32)), optional(tensor(int64)), optional(tensor(bfloat16)), optional(tensor(float16)), optional(tensor(float)), optional(tensor(double)), optional(tensor(string)), optional(tensor(bool)), optional(tensor(complex64)), optional(tensor(complex128)), optional(tensor(float8e4m3fn)), optional(tensor(float8e4m3fnuz)), optional(tensor(float8e5m2)), optional(tensor(float8e5m2fnuz)), optional(tensor(uint4)), optional(tensor(int4)), optional(tensor(float4e2m1)), optional(tensor(float8e8m0)), optional(tensor(uint2)), optional(tensor(int2)), optional(tensor(float6e2m3)), optional(tensor(float6e3m2)), optional(seq(tensor(uint8))), optional(seq(tensor(uint16))), optional(seq(tensor(uint32))), optional(seq(tensor(uint64))), optional(seq(tensor(int8))), optional(seq(tensor(int16))), optional(seq(tensor(int32))), optional(seq(tensor(int64))), optional(seq(tensor(bfloat16))), optional(seq(tensor(float16))), optional(seq(tensor(float))), optional(seq(tensor(double))), optional(seq(tensor(string))), optional(seq(tensor(bool))), optional(seq(tensor(complex64))), optional(seq(tensor(complex128))), optional(seq(tensor(float8e4m3fn))), optional(seq(tensor(float8e4m3fnuz))), optional(seq(tensor(float8e5m2))), optional(seq(tensor(float8e5m2fnuz))), optional(seq(tensor(uint4))), optional(seq(tensor(int4))), optional(seq(tensor(float4e2m1))), optional(seq(tensor(float8e8m0))), optional(seq(tensor(uint2))), optional(seq(tensor(int2))), optional(seq(tensor(float6e2m3))), optional(seq(tensor(float6e3m2)))</tt> — Constrain output type to all optional tensor or optional sequence types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_3cf102de-c40e-8174-bd78-c1920e918e64"><p id="_ec250d4e-ff4d-64f8-77cb-9318d5f6da8b">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_1e11b38b-fd5c-1dc8-4730-af44a7bae886"><p id="_12fb5a55-228c-0b28-47fe-db16ec47de8d">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_0d2313ad-860a-e329-b3b5-9c31c1e65f13" anchor="op-ai-onnx-default-optionalgetelement" obligation="normative">
<title id="_b06c224f-66b2-c7f7-94aa-ac21e36a44aa">OptionalGetElement</title>
<p id="_c76c1679-fce7-2ccf-cc24-cdd243416c0c">If the input is a tensor or sequence type, it returns the input. If the input is an optional type, it outputs the element in the input. It is an error if the input is an empty optional-type (i.e. does not have an element) and the behavior is undefined in this case.</p>

<dl id="_9259dace-592d-6473-fbd2-4101431aa457"><dt>Domain</dt>
<dd id="_f4559117-155c-0b2d-dcb0-c7981d92e2d6"><p id="_bbb53238-7a9b-0ea7-21c4-69ba5062fc1b"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_726d1fef-be10-0de9-7c3a-756d8b230b16"><p id="_7d355458-0b88-6b9b-86af-d9ea3c5ad533">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_d5f9577d-0fdb-1dc5-d9c0-55a25fe1c580"><p id="_42433bff-9d0d-0a75-1eb2-473d5a619c7f">15, 18</p>
</dd>
<dt>Inputs</dt>
<dd id="_44a126b7-7eb9-2054-8b3a-8c363b4eea1d"><p id="_9018b567-6534-9564-992c-ba63aa76cc0e"><tt>input : O</tt> — The optional input.</p>
</dd>
<dt>Outputs</dt>
<dd id="_70cfacd0-9913-f088-98c3-3f72856b84c9"><p id="_3a1c1364-8739-8e23-0e24-de19160cc7c1"><tt>output : V</tt> — Output element in the optional input.</p>
</dd>
<dt>Attributes</dt>
<dd id="_3d2ac239-6555-c3d8-39b4-ce7b915b7146"><p id="_811167b4-52d0-a6cd-1afb-e14498037093">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_38d09ccf-695d-fb22-fa70-c3db207f618f"><p id="_684eaa6e-646f-9013-c3f4-1d5f1332ddfd"><tt>O : optional(tensor(uint8)), optional(tensor(uint16)), optional(tensor(uint32)), optional(tensor(uint64)), optional(tensor(int8)), optional(tensor(int16)), optional(tensor(int32)), optional(tensor(int64)), optional(tensor(bfloat16)), optional(tensor(float16)), optional(tensor(float)), optional(tensor(double)), optional(tensor(string)), optional(tensor(bool)), optional(tensor(complex64)), optional(tensor(complex128)), optional(tensor(float8e4m3fn)), optional(tensor(float8e4m3fnuz)), optional(tensor(float8e5m2)), optional(tensor(float8e5m2fnuz)), optional(tensor(uint4)), optional(tensor(int4)), optional(tensor(float4e2m1)), optional(tensor(float8e8m0)), optional(tensor(uint2)), optional(tensor(int2)), optional(tensor(float6e2m3)), optional(tensor(float6e3m2)), optional(seq(tensor(uint8))), optional(seq(tensor(uint16))), optional(seq(tensor(uint32))), optional(seq(tensor(uint64))), optional(seq(tensor(int8))), optional(seq(tensor(int16))), optional(seq(tensor(int32))), optional(seq(tensor(int64))), optional(seq(tensor(bfloat16))), optional(seq(tensor(float16))), optional(seq(tensor(float))), optional(seq(tensor(double))), optional(seq(tensor(string))), optional(seq(tensor(bool))), optional(seq(tensor(complex64))), optional(seq(tensor(complex128))), optional(seq(tensor(float8e4m3fn))), optional(seq(tensor(float8e4m3fnuz))), optional(seq(tensor(float8e5m2))), optional(seq(tensor(float8e5m2fnuz))), optional(seq(tensor(uint4))), optional(seq(tensor(int4))), optional(seq(tensor(float4e2m1))), optional(seq(tensor(float8e8m0))), optional(seq(tensor(uint2))), optional(seq(tensor(int2))), optional(seq(tensor(float6e2m3))), optional(seq(tensor(float6e3m2))), tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2), tensor(float6e2m3), tensor(float6e3m2), seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(bfloat16)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128)), seq(tensor(float8e4m3fn)), seq(tensor(float8e4m3fnuz)), seq(tensor(float8e5m2)), seq(tensor(float8e5m2fnuz)), seq(tensor(uint4)), seq(tensor(int4)), seq(tensor(float4e2m1)), seq(tensor(float8e8m0)), seq(tensor(uint2)), seq(tensor(int2)), seq(tensor(float6e2m3)), seq(tensor(float6e3m2))</tt> — Constrain input type to optional, tensor and sequence types.<br/> <tt>V : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2), tensor(float6e2m3), tensor(float6e3m2), seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(bfloat16)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128)), seq(tensor(float8e4m3fn)), seq(tensor(float8e4m3fnuz)), seq(tensor(float8e5m2)), seq(tensor(float8e5m2fnuz)), seq(tensor(uint4)), seq(tensor(int4)), seq(tensor(float4e2m1)), seq(tensor(float8e8m0)), seq(tensor(uint2)), seq(tensor(int2)), seq(tensor(float6e2m3)), seq(tensor(float6e3m2))</tt> — Constrain output type to all tensor or sequence types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_48831922-0636-7e96-2e9e-5f36f174a45c"><p id="_a7086a19-111f-a30e-a9c0-f90f281d2987">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_8c05c6dd-fc30-0322-cc0c-be3e5cc60f93"><p id="_29ed696f-7832-5a38-9d8f-a8b25e77cc2e">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_b2ee3f79-115d-dfd8-1b45-d3b1b5841c97" anchor="op-ai-onnx-default-optionalhaselement" obligation="normative">
<title id="_9b58405f-ffc6-a987-c8d4-365388363472">OptionalHasElement</title>
<p id="_06597eaa-6ddf-8f44-803a-18116fefd803">Returns true if (1) the input is an optional-type and contains an element, or, (2) the input is a tensor or sequence type. If the input is not provided or is an empty optional-type, this op returns false.</p>

<dl id="_b697dda0-9a6d-19f0-df3e-43ae8e303b8e"><dt>Domain</dt>
<dd id="_11deea09-b617-96af-22e0-d76ef3df953d"><p id="_857b68b0-63f8-d071-853a-19a018e144eb"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_415c033a-a96f-7646-c412-86e36cbddebf"><p id="_33798c5c-e4ea-e9a5-267d-9e94385a891b">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_454092a8-635d-7d8b-0f7e-582172a7e6b1"><p id="_365643a4-14d3-9862-7a38-1423fcf6822c">15, 18</p>
</dd>
<dt>Inputs (0 — 1)</dt>
<dd id="_2d0896fa-4891-5fa1-6740-3867dbafaa64"><p id="_2421d4b9-ce13-12ca-b1e6-d8ff20844aca"><tt>input (optional) : O</tt> — The optional input.</p>
</dd>
<dt>Outputs</dt>
<dd id="_d895aae3-6c26-f679-1a37-93ce8eddd47a"><p id="_3d55013e-0b25-1dac-2cdc-e18767c39665"><tt>output : B</tt> — A scalar boolean tensor. If true, it indicates that optional-type input contains an element. Otherwise, it is empty.</p>
</dd>
<dt>Attributes</dt>
<dd id="_d5443494-26f0-789a-910c-c6162dc32381"><p id="_0f9572b1-93ac-e9b2-3008-1f1e5194b7e4">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_74ece45c-93b8-aa86-a8a6-ffbc4a42047f"><p id="_fc9659c6-0249-c9a1-6b04-98b1ddc445e1"><tt>O : optional(tensor(uint8)), optional(tensor(uint16)), optional(tensor(uint32)), optional(tensor(uint64)), optional(tensor(int8)), optional(tensor(int16)), optional(tensor(int32)), optional(tensor(int64)), optional(tensor(bfloat16)), optional(tensor(float16)), optional(tensor(float)), optional(tensor(double)), optional(tensor(string)), optional(tensor(bool)), optional(tensor(complex64)), optional(tensor(complex128)), optional(tensor(float8e4m3fn)), optional(tensor(float8e4m3fnuz)), optional(tensor(float8e5m2)), optional(tensor(float8e5m2fnuz)), optional(tensor(uint4)), optional(tensor(int4)), optional(tensor(float4e2m1)), optional(tensor(float8e8m0)), optional(tensor(uint2)), optional(tensor(int2)), optional(tensor(float6e2m3)), optional(tensor(float6e3m2)), optional(seq(tensor(uint8))), optional(seq(tensor(uint16))), optional(seq(tensor(uint32))), optional(seq(tensor(uint64))), optional(seq(tensor(int8))), optional(seq(tensor(int16))), optional(seq(tensor(int32))), optional(seq(tensor(int64))), optional(seq(tensor(bfloat16))), optional(seq(tensor(float16))), optional(seq(tensor(float))), optional(seq(tensor(double))), optional(seq(tensor(string))), optional(seq(tensor(bool))), optional(seq(tensor(complex64))), optional(seq(tensor(complex128))), optional(seq(tensor(float8e4m3fn))), optional(seq(tensor(float8e4m3fnuz))), optional(seq(tensor(float8e5m2))), optional(seq(tensor(float8e5m2fnuz))), optional(seq(tensor(uint4))), optional(seq(tensor(int4))), optional(seq(tensor(float4e2m1))), optional(seq(tensor(float8e8m0))), optional(seq(tensor(uint2))), optional(seq(tensor(int2))), optional(seq(tensor(float6e2m3))), optional(seq(tensor(float6e3m2))), tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2), tensor(float6e2m3), tensor(float6e3m2), seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(bfloat16)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128)), seq(tensor(float8e4m3fn)), seq(tensor(float8e4m3fnuz)), seq(tensor(float8e5m2)), seq(tensor(float8e5m2fnuz)), seq(tensor(uint4)), seq(tensor(int4)), seq(tensor(float4e2m1)), seq(tensor(float8e8m0)), seq(tensor(uint2)), seq(tensor(int2)), seq(tensor(float6e2m3)), seq(tensor(float6e3m2))</tt> — Constrain input type to optional, tensor and sequence types.<br/> <tt>B : tensor(bool)</tt> — Constrain output to a boolean tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_2d2e7cce-5f47-ae7f-0129-227c7e42984b"><p id="_b72136f1-0366-3346-dc1f-c8440760a2a7"><tt>test_optional_get_element_optional_sequence</tt>, <tt>test_optional_get_element_sequence</tt>, <tt>test_optional_get_element_optional_tensor</tt>, <tt>test_optional_get_element_tensor</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_12d28766-a4b2-feb4-4c2e-28901a1515f8"><p id="_f03114f0-3373-8c1b-3222-2b0bb74ca384">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_8cfae391-390b-9c0a-45b8-63c4a5c28fc5" anchor="op-ai-onnx-default-or" obligation="normative">
<title id="_37beca1b-9352-4913-11c9-eccaacfa432a">Or</title>
<p id="_de84b99c-0c98-c693-64ee-c7e02c083bac">Returns the tensor resulted from performing the <tt>or</tt> logical operation elementwise on the input tensors  <tt>A</tt> and <tt>B</tt> (with Numpy-style broadcasting support).</p>

<p id="_7401d8f5-b801-190a-51ee-2668cff5551b">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_ff005cd6-b7d7-6f49-9dd8-06ab9c86c0de"><dt>Domain</dt>
<dd id="_b5f86ed5-97f5-9d66-ccb9-921c6d5cbd52"><p id="_fa42fc46-ca47-04b1-aed9-4e5d329f185e"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_c783f42b-83e3-b195-d044-39c20ec0d591"><p id="_be61fecf-7d78-7120-a8f8-958b44d5d89f">7</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_185cf669-ecdc-7d30-335b-7879c65c49e2"><p id="_d7a7ae56-6192-4902-23ae-a8e392c54013">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_f2eec055-cdf6-4b27-22de-b10864cc40b6"><p id="_4783e3ca-3c09-1926-1bbd-9cf26a43ea96"><tt>A (non-differentiable) : T</tt> — First input operand for the logical operator.<br/> <tt>B (non-differentiable) : T</tt> — Second input operand for the logical operator.</p>
</dd>
<dt>Outputs</dt>
<dd id="_e6aa74aa-a503-7a29-9618-0e51f1e5ac7d"><p id="_7f349a82-f3dd-9892-ff07-4613ef4e9ce6"><tt>C (non-differentiable) : T1</tt> — Result tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_33b359d6-0fb6-6906-4ec3-6e33a2743772"><p id="_f980a5d0-7f32-642d-72b8-8580a6b70279">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_1735297d-6885-1a90-87ee-264aa926e97b"><p id="_8dbe101a-d9e9-2d34-bf8b-1d6634ae592d"><tt>T : tensor(bool)</tt> — Constrain input to boolean tensor.<br/> <tt>T1 : tensor(bool)</tt> — Constrain output to boolean tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_6f3471e1-c8e2-f8f6-ef6c-89a8d5bc8b61"><p id="_97a69cae-06d5-f10c-e418-456ea49d8526"><tt>test_or2d</tt>, <tt>test_or3d</tt>, <tt>test_or4d</tt>, <tt>test_or_bcast3v1d</tt>, <tt>test_or_bcast3v2d</tt>, <tt>test_or_bcast4v2d</tt>, <tt>test_or_bcast4v3d</tt>, <tt>test_or_bcast4v4d</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_659f977d-8406-1140-4cce-f04ec7e21646"><p id="_5f29eb26-04da-e0d6-a446-9814b6d591e1">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_c7a9c8b9-0b00-4f05-2285-018c465aefbd" anchor="op-ai-onnx-default-prelu" obligation="normative">
<title id="_e6a0589d-4b1c-b3bd-bb60-4107d1303a2d">PRelu</title>
<p id="_c49c8a54-1f28-dbda-fdce-d10d4f74b2d2">PRelu takes input data (<tt>Tensor&lt;T&gt;</tt>) and slope tensor as input, and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the function <tt>f(x) = slope * x for x &lt; 0</tt>, <tt>f(x) = x for x &gt;= 0</tt>., is applied to the data tensor elementwise. This operator supports  <strong>unidirectional broadcasting</strong> (tensor slope should be unidirectional broadcastable to input tensor X); for more details please check the doc.</p>

<dl id="_019c72eb-fcc8-0610-9e28-1075ce32db3c"><dt>Domain</dt>
<dd id="_5e31824f-26c1-e708-2284-03abef2d1b66"><p id="_bf084c86-61d0-9ddc-2c49-870ebd18328a"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_3dc824f0-edf6-2c9e-3b13-f534f453020a"><p id="_d9e33ddc-f7bd-be72-30b3-e3b7caa3a2fc">16</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_e1537af4-0abb-a866-1586-e67e93e29675"><p id="_2d58fdb5-bb6d-dc7a-3a0d-3f65e6999903">1, 6, 7, 9</p>
</dd>
<dt>Inputs</dt>
<dd id="_916d7ba6-43a6-98c6-adc0-b3e81294a4a1"><p id="_0653d1f6-c5b1-8168-5940-757286bafd6c"><tt>X (differentiable) : T</tt> — Input tensor<br/> <tt>slope (differentiable) : T</tt> — Slope tensor. The shape of slope can be smaller than first input X; if so, its shape must be unidirectional broadcastable to X</p>
</dd>
<dt>Outputs</dt>
<dd id="_99f204c7-64a4-1d7e-84ff-ad315c37a7c6"><p id="_a066ff15-85e4-f78d-f7ea-72fa076834d6"><tt>Y (differentiable) : T</tt> — Output tensor (same size as X)</p>
</dd>
<dt>Attributes</dt>
<dd id="_c23d0208-2ef2-3379-741e-5f044c8eca40"><p id="_1d577edd-9b28-f7ff-4567-ac868f4738b7">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_da9fc3ff-c83d-e2d7-b92f-df5487222f01"><p id="_93f455ac-8de8-4439-c9fe-0fee94b2f006"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(uint32), tensor(uint64), tensor(int32), tensor(int64)</tt> — Constrain input and output types to float/int tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_93cd1a3f-a560-7a14-bdfa-67c7fa10f07b"><p id="_bc22f8fb-84ef-8c30-1181-f90a06bace6f"><tt>test_prelu_example</tt>, <tt>test_prelu_broadcast</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_9a732242-cc50-7290-57bf-71611b1ba00a"><p id="_96766f5c-d95e-d772-7855-836bf3c9f2c5">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_a54fbc4c-f5fc-9f66-ed3a-7aad021af773" anchor="op-ai-onnx-default-pad" obligation="normative">
<title id="_35b4fde4-5bf4-df13-6673-a990d597f301">Pad</title>
<p id="_7855888e-138b-33ee-3286-f49598787cf1">Given a tensor containing the data to be padded (<tt>data</tt>), a tensor containing the number of start and end pad values for axis (<tt>pads</tt>), (optionally) a <tt>mode</tt>, and (optionally) <tt>constant_value</tt>, a padded tensor (<tt>output</tt>) is generated.</p>

<p id="_6f49320e-643c-9d08-3861-0e6bf5cd5340">The four supported <tt>modes</tt> are (similar to corresponding modes supported by <tt>numpy.pad</tt>):</p>

<p id="_48130522-098f-e5d0-4b56-0959bcf3986f">1) <tt>constant</tt>(default) — pads with a given constant value as specified by <tt>constant_value</tt> (which defaults to 0, empty string, or False)</p>

<p id="_d73fc7cf-049e-2ab1-02e4-640d09cdc153">2) <tt>reflect</tt> — pads with the reflection of the vector mirrored on the first and last values of the vector along each axis</p>

<p id="_b45834d8-8724-f110-e665-6b06471ded9f">3) <tt>edge</tt> — pads with the edge values of array</p>

<p id="_30921c83-2784-815e-04df-46373625651d">4) <tt>wrap</tt> — wrap-around padding as if the data tensor forms a torus</p>

<p id="_8d0e957c-869c-475d-6ddb-9f7d9a739770">Example 1 (<tt>constant</tt> mode):</p>

<p id="_b4727007-58eb-7db2-ad3f-0c3c1f69fefe">Insert 0 pads to the beginning of the second dimension.</p>

<sourcecode id="_26ff1fd9-8e0e-1fe2-3c7e-8b7601f951f8" unnumbered="true"><body>data = [
    [1.0, 1.2],
    [2.3, 3.4],
    [4.5, 5.7],
]

pads = [0, 2, 0, 0]

mode = 'constant'

constant_value = 0.0

output = [
    [0.0, 0.0, 1.0, 1.2],
    [0.0, 0.0, 2.3, 3.4],
    [0.0, 0.0, 4.5, 5.7],
]</body></sourcecode>


<p id="_e8cf549d-c5fc-2968-ccdd-87fe9c6e8686">Example 2 (<tt>reflect</tt> mode):</p>

<sourcecode id="_25d51e8a-1c34-0a16-3e0e-b4686f7bd6fa" unnumbered="true"><body>data = [
    [1.0, 1.2],
    [2.3, 3.4],
    [4.5, 5.7],
]

pads = [0, 2, 0, 0]

mode = 'reflect'

output = [
    [1.0, 1.2, 1.0, 1.2],
    [2.3, 3.4, 2.3, 3.4],
    [4.5, 5.7, 4.5, 5.7],
]</body></sourcecode>


<p id="_16c2058a-ddf1-56b8-ae19-f55711aa5a26">Example 3 (<tt>edge</tt> mode):</p>

<sourcecode id="_ed408a16-20d9-ec6a-8439-1200242d7953" unnumbered="true"><body>data = [
    [1.0, 1.2],
    [2.3, 3.4],
    [4.5, 5.7],
]

pads = [0, 2, 0, 0]

mode = 'edge'

output = [
    [1.0, 1.0, 1.0, 1.2],
    [2.3, 2.3, 2.3, 3.4],
    [4.5, 4.5, 4.5, 5.7],
]</body></sourcecode>


<p id="_d536e572-e9ca-03b5-f4bd-b8b2b7c05dfc">Example 4 (<tt>wrap</tt> mode):</p>

<sourcecode id="_9c5b40ea-d85f-bc31-d7f4-c41afbb1cf63" unnumbered="true"><body>data = [
    [1.0, 1.2],
    [2.3, 3.4],
    [4.5, 5.7],
]

pads = [2, 1, 1, 1]

mode = 'wrap'

output = [
    [3.4, 2.3, 3.4, 2.3],
    [5.7, 4.5, 5.7, 4.5],
    [1.2, 1.0, 1.2, 1.0],
    [3.4, 2.3, 3.4, 2.3],
    [5.7, 4.5, 5.7, 4.5],
    [1.2, 1.0, 1.2, 1.0],
]</body></sourcecode>


<dl id="_91b9b6d3-3264-cfe4-6fdd-582d0b2ecfe2"><dt>Domain</dt>
<dd id="_f3ae7735-0064-1394-e04e-0117fbeb66af"><p id="_72f8b64a-792e-292c-b2cc-3cdd449271cb"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_a7bef8b5-543b-461f-c113-ab93f81dfb89"><p id="_582875a8-4d29-45fc-9049-b112cfb574ac">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_b7ddfd7a-3bf2-87c6-c748-e34b972266b8"><p id="_470280b5-fd26-2ce6-ebba-9f1bff98ac6d">1, 2, 11, 13, 18, 19, 21, 23, 24</p>
</dd>
<dt>Inputs (2 — 4)</dt>
<dd id="_c89c95e4-57a5-081b-7cf2-8fdbf34e1cf9"><p id="_097b21d8-d827-511d-9023-e8763a9090e4"><tt>data (differentiable) : T</tt> — Input tensor.<br/> <tt>pads (non-differentiable) : tensor(int64)</tt> — Tensor of integers indicating the number of padding elements to add or remove (if negative) at the beginning and end of each axis. For 2D input tensor, it is the number of pixels. <tt>pads</tt> should be a 1D tensor of shape [2 * num_axes] where <tt>num_axes</tt> refers to the number of elements in the <tt>axes</tt> input or the input rank if <tt>axes</tt> are not provided explicitly. <tt>pads</tt> format should be: [x1_begin, x2_begin, …​, x1_end, x2_end,…​], where xi_begin is the number of pad values added at the beginning of axis <tt>axes[i]</tt> and xi_end, the number of pad values added at the end of axis <tt>axes[i]</tt>.<br/> <tt>constant_value (optional, non-differentiable) : T</tt> — (Optional) A scalar value to be used if the mode chosen is <tt>constant</tt> (by default it is 0, empty string or False).<br/> <tt>axes (optional, non-differentiable) : Tind</tt> — 1-D tensor of axes that <tt>pads</tt> apply to. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(data). Behavior is undefined if an axis is repeated. If not provided, all axes are assumed (<tt>[0, 1, ..., input_rank-1]</tt>).</p>
</dd>
<dt>Outputs</dt>
<dd id="_fe5d67b4-873e-162a-bfd2-638272ce14eb"><p id="_49bc43f5-2f3a-46e7-d523-3d56a0db8a97"><tt>output (differentiable) : T</tt> — Tensor after padding.</p>
</dd>
<dt>Attributes</dt>
<dd id="_23c9d4bc-8b51-9a30-cec0-c36ab152f6b1"><p id="_1dde0fef-e82a-e294-c593-889826bca715"><tt>mode : string (default is constant)</tt> — Supported modes: <tt>constant</tt>(default), <tt>reflect</tt>, <tt>edge</tt>, <tt>wrap</tt></p>
</dd>
<dt>Type constraints</dt>
<dd id="_0b32b327-4674-373b-f769-f69a35314cff"><p id="_77ec8e2c-7dd5-d45f-53e3-80f741978eb0"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2)</tt> — Constrain input and output types to all tensor types up to IRv13.<br/> <tt>Tind : tensor(int32), tensor(int64)</tt> — Constrain indices to integer types</p>
</dd>
<dt>Test vectors</dt>
<dd id="_69b4d4ec-08d2-501f-b3dd-73394b5e739c"><p id="_b02deebe-2187-c54d-a47f-594023576e66"><tt>test_constant_pad</tt>, <tt>test_constant_pad_axes</tt>, <tt>test_constant_pad_negative_axes</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_ec908aef-8b87-a308-2383-00e20f4914a5"><p id="_2e9330a2-9b58-ea6f-4dbf-7b765e9a9986">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_c565663b-2dbc-4e4d-a70f-83a8a72320b5" anchor="op-ai-onnx-default-pow" obligation="normative">
<title id="_f1102ae1-18c9-9f2c-8bd6-92d08fbc3f27">Pow</title>
<p id="_c8555d3b-53fa-cf51-2162-234eebd9a857">Pow takes input data (<tt>Tensor&lt;T&gt;</tt>) and exponent Tensor, and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the function <tt>f(x) = x^exponent</tt>, is applied to the data tensor elementwise. This operator supports  <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_f14b3a1c-8714-f2af-1311-7389aca45878"><dt>Domain</dt>
<dd id="_49c835fc-3413-f276-977f-d66684fb69b6"><p id="_db1d2cb4-731e-e13f-5266-63a05987b5a9"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_8125812a-347c-ecfa-4270-b6374e65aa78"><p id="_1f5ea534-fc03-9551-7e15-e0b96575fd84">15</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_d895f5b3-4f2e-2d50-cbb6-4ba10c64f48d"><p id="_0cd64b97-c211-330f-dc26-f971f1549d86">1, 7, 12, 13</p>
</dd>
<dt>Inputs</dt>
<dd id="_836e43b3-3bdd-a081-b64b-2f89eb8e041e"><p id="_5fff6b55-3743-cec9-8e99-1730f0b3c1b6"><tt>X (differentiable) : T</tt> — First operand, base of the exponent.<br/> <tt>Y (differentiable) : T1</tt> — Second operand, power of the exponent.</p>
</dd>
<dt>Outputs</dt>
<dd id="_2cb17e29-5766-f2e9-2d0b-90519eff56c6"><p id="_6fd8fc3b-cc76-0440-d48d-8c4b9fb3addf"><tt>Z (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_9b118152-cbfc-d383-8b3f-c1ec7f5ae90a"><p id="_ad4ca628-3738-3f09-95bc-2f2184b69e6a">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_925736e2-f606-74f8-d2b5-0f064cb0bb12"><p id="_b522c999-8fde-f854-6796-f2f2085286ad"><tt>T : tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input X and output types to float/int tensors.<br/> <tt>T1 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input Y types to float/int tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_c0b9fa31-1bc6-cdd3-e905-dde6e7c49997"><p id="_6feabbe2-6cf0-bf70-2295-4dd686dad863"><tt>test_pow_example</tt>, <tt>test_pow</tt>, <tt>test_pow_bcast_scalar</tt>, <tt>test_pow_bcast_array</tt>, <tt>test_pow_types_float32_int64</tt>, <tt>test_pow_types_int64_float32</tt>, <tt>test_pow_types_float32_int32</tt>, <tt>test_pow_types_int32_float32</tt>, <tt>test_pow_types_float32_uint64</tt>, <tt>test_pow_types_float32_uint32</tt>, <tt>test_pow_types_int64_int64</tt>, <tt>test_pow_types_int32_int32</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_ee604a24-e684-d7ce-e741-f0d10e844ed6"><p id="_3a6484b4-0f48-0f75-05e6-b82bf5328417">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_518c8490-8890-65db-4400-a9fcb4ca4ff6" anchor="op-ai-onnx-default-qlinearconv" obligation="normative">
<title id="_61937fa7-31bb-5e14-d985-4b8c0ca3cb3e">QLinearConv</title>
<p id="_36263de8-d232-aaed-5f51-2af745db71f8">The convolution operator consumes a quantized input tensor, its scale and zero point, a quantized filter, its scale and zero point, and output’s scale and zero point, and computes the quantized output. Each scale and zero-point pair must have same shape. It means they must be either scalars (per tensor) or 1-D tensors (per output channel). Each input or output and its related zero point must have same type. When bias is present it must be quantized using scale = input scale * weight scale and zero point as 0.</p>

<dl id="_6237656b-5d06-4b63-a45c-504b13070cf2"><dt>Domain</dt>
<dd id="_1aa4bb18-d5b0-50d8-bb6d-f3b95390ffa3"><p id="_1eeed301-f2b8-49b2-d0a5-677763c44588"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_d5584c36-d4aa-ed52-638f-da6500c99c35"><p id="_42c024a2-0641-d18f-595a-7377e556ab12">10</p>
</dd>
<dt>Inputs (8 — 9)</dt>
<dd id="_8ad1051e-bbd6-f2d2-3519-097066a3d660"><p id="_454fa53d-6e13-c230-ca3d-0932bc1acf2d"><tt>x : T1</tt> — Input data tensor from previous layer; has size (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and width. Note that this is for the 2D image. Otherwise the size is (N x C x D1 x D2 …​ x Dn). Optionally, if dimension denotation is in effect, the operation expects input data tensor to arrive with the dimension denotation of [DATA_BATCH, DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE …​].<br/> <tt>x_scale : tensor(float)</tt> — Scale tensor for input ‘x’. It’s a scalar, which means a per-tensor/layer quantization.<br/> <tt>x_zero_point : T1</tt> — Zero point tensor for input ‘x’. It’s a scalar, which means a per-tensor/layer quantization.<br/> <tt>w : T2</tt> — The weight tensor that will be used in the convolutions; has size (M x C/group x kH x kW), where C is the number of channels, and kH and kW are the height and width of the kernel, and M is the number of feature maps. For more than 2 dimensions, the kernel shape will be (M x C/group x k1 x k2 x …​ x kn), where (k1 x k2 x …​ kn) is the dimension of the kernel. Optionally, if dimension denotation is in effect, the operation expects the weight tensor to arrive with the dimension denotation of [FILTER_OUT_CHANNEL, FILTER_IN_CHANNEL, FILTER_SPATIAL, FILTER_SPATIAL …​]. X.shape[1] == (W.shape[1] * group) == C (assuming zero based indices for the shape array). Or in other words FILTER_IN_CHANNEL should be equal to DATA_CHANNEL.<br/> <tt>w_scale : tensor(float)</tt> — Scale tensor for input ‘w’. It could be a scalar or a 1-D tensor, which means a per-tensor/layer or per output channel quantization. If it’s a 1-D tensor, its number of elements should be equal to the number of output channels (M).<br/> <tt>w_zero_point : T2</tt> — Zero point tensor for input ‘w’. It could be a scalar or a 1-D tensor, which means a per-tensor/layer or per output channel quantization. If it’s a 1-D tensor, its number of elements should be equal to the number of output channels (M).<br/> <tt>y_scale : tensor(float)</tt> — Scale tensor for output ‘y’. It’s a scalar, which means a per-tensor/layer quantization.<br/> <tt>y_zero_point : T3</tt> — Zero point tensor for output ‘y’. It’s a scalar, which means a per-tensor/layer quantization.<br/> <tt>B (optional) : T4</tt> — Optional 1D bias to be added to the convolution, has size of M. Bias must be quantized using scale = x_scale * w_scale and zero_point = 0</p>
</dd>
<dt>Outputs</dt>
<dd id="_93421d3e-9b4a-ffae-ecda-6dd25d6575fe"><p id="_a2ca6892-f92b-d046-10f4-d559eaa89d8c"><tt>y : T3</tt> — Output data tensor that contains the result of the convolution. The output dimensions are functions of the kernel size, stride size, and pad lengths.</p>
</dd>
<dt>Attributes</dt>
<dd id="_0bda89e2-154d-162c-e4d7-6ac1dc0ae87f"><p id="_1b65286d-bc0b-e65b-433a-34ad86020fc3"><tt>auto_pad : string (default is NOTSET)</tt> — auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID. Where default value is NOTSET, which means explicit padding is used. SAME_UPPER or SAME_LOWER mean pad the input so that <tt>output_shape[i] = ceil(input_shape[i] / strides[i])</tt> for each axis <tt>i</tt>. The padding is split between the two sides equally or almost equally (depending on whether it is even or odd). In case the padding is an odd number, the extra padding is added at the end for SAME_UPPER and at the beginning for SAME_LOWER.<br/> <tt>dilations : list of ints</tt> — dilation value along each spatial axis of the filter. If not present, the dilation defaults to 1 along each spatial axis.<br/> <tt>group : int (default is 1)</tt> — number of groups input channels and output channels are divided into. default is 1.<br/> <tt>kernel_shape : list of ints</tt> — The shape of the convolution kernel. If not present, should be inferred from input ‘w’.<br/> <tt>pads : list of ints</tt> — Padding for the beginning and ending along each spatial axis, it can take any value greater than or equal to 0.The value represent the number of pixels added to the beginning and end part of the corresponding axis.<tt>pads</tt> format should be as follow [x1_begin, x2_begin…​x1_end, x2_end,…​], where xi_begin the number ofpixels added at the beginning of axis <tt>i</tt> and xi_end, the number of pixels added at the end of axis <tt>i</tt>.This attribute cannot be used simultaneously with auto_pad attribute. If not present, the padding defaultsto 0 along start and end of each spatial axis.<br/> <tt>strides : list of ints</tt> — Stride along each spatial axis. If not present, the stride defaults to 1 along each spatial axis.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_e07ba860-2998-2bb6-fda5-802b2bf8650f"><p id="_2e9950b8-9945-171b-5a30-9b911cb509eb"><tt>T1 : tensor(int8), tensor(uint8)</tt> — Constrain input type to 8-bit integer tensor.<br/> <tt>T2 : tensor(int8), tensor(uint8)</tt> — Constrain filter type to 8-bit integer tensor.<br/> <tt>T3 : tensor(int8), tensor(uint8)</tt> — Constrain output type to 8-bit integer tensor.<br/> <tt>T4 : tensor(int32)</tt> — Constrain bias type to 32-bit integer tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_08e32cb5-3a62-ed48-e65c-af59ede8466a"><p id="_e9b7e403-4756-d110-1246-7573aa6f0036"><tt>test_qlinearconv</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_570b3580-417a-0be1-bd18-6ddcb29cc887"><p id="_fb47f528-9251-df7d-be58-0a3cc7d9d6f1">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_e4e08029-8fd5-98d8-ae91-49843f338d05" anchor="op-ai-onnx-default-qlinearmatmul" obligation="normative">
<title id="_cfa8316d-28f1-1ecc-d9d3-93c9400d5637">QLinearMatMul</title>
<p id="_9428ca62-258c-bd5e-980d-0cf9fde38289">Matrix product that behaves like <link target="https://numpy.org/doc/stable/reference/generated/numpy.matmul.html">numpy.matmul</link>. It consumes two quantized input tensors, their scales and zero points, scale and zero point of output, and computes the quantized output. The quantization formula is y = saturate((x / y_scale) + y_zero_point). For (x / y_scale), it is rounding to nearest ties to even. Refer to  <link target="https://en.wikipedia.org/wiki/Rounding"/> for details. Scale and zero point must have same shape. They must be either scalar (per tensor) or N-D tensor (per row for ‘a’ and per column for ‘b’). Scalar refers to per tensor quantization whereas N-D refers to per row or per column quantization. If the input is 2D of shape [M, K] then zero point and scale tensor may be an M element vector [v_1, v_2, …​, v_M] for per row quantization and K element vector of shape [v_1, v_2, …​, v_K] for per column quantization. If the input is N-D tensor with shape [D1, D2, M, K] then zero point and scale tensor may have shape [D1, D2, M, 1] for per row quantization and shape [D1, D2, 1, K] for per column quantization. Production must never overflow, and accumulation may overflow if and only if in 32 bits.</p>

<dl id="_0bedc25c-0028-75d3-4f62-9c09e7757962"><dt>Domain</dt>
<dd id="_1927fef7-7b28-8e32-53d0-8f5b1e6b13ac"><p id="_d79b7a7e-7d94-298f-e137-f420d43ccaf0"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_c1cd9b75-f388-fd8c-3b74-0c88c5542a6e"><p id="_ca324f4c-51a9-0c22-4094-373eeaccfcb6">21</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_df26cec4-8b36-8e17-d95c-52933462d0c6"><p id="_a6f9f392-f39c-5383-3c1a-2697a719d234">10</p>
</dd>
<dt>Inputs</dt>
<dd id="_8d816029-95cb-2dd8-ad97-f3ed3dbba512"><p id="_3ff842b5-5d4b-dac1-bd3e-a8cafd3a99ed"><tt>a (non-differentiable) : T1</tt> — N-dimensional quantized matrix a<br/> <tt>a_scale (non-differentiable) : TS</tt> — scale of quantized input a<br/> <tt>a_zero_point (non-differentiable) : T1</tt> — zero point of quantized input a<br/> <tt>b (non-differentiable) : T2</tt> — N-dimensional quantized matrix b<br/> <tt>b_scale (non-differentiable) : TS</tt> — scale of quantized input b<br/> <tt>b_zero_point (non-differentiable) : T2</tt> — zero point of quantized input b<br/> <tt>y_scale (non-differentiable) : TS</tt> — scale of quantized output y<br/> <tt>y_zero_point (non-differentiable) : T3</tt> — zero point of quantized output y</p>
</dd>
<dt>Outputs</dt>
<dd id="_2fcbac69-b058-1899-5424-48519e91a2a8"><p id="_d39d18d2-bba3-c672-4e3b-6cf4ad8b10f5"><tt>y (non-differentiable) : T3</tt> — Quantized matrix multiply results from a * b</p>
</dd>
<dt>Attributes</dt>
<dd id="_d2818388-7105-9610-325b-b29d86bfea66"><p id="_8d736fd4-b749-896a-5f46-8514112678b7">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_cfe7363c-a927-a7de-1eed-118a525e57c5"><p id="_881d8d4d-509b-b462-f8f1-daac4b35fea1"><tt>TS : tensor(float), tensor(float16), tensor(bfloat16)</tt> — Constrain scales.<br/> <tt>T1 : tensor(int8), tensor(uint8), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz)</tt> — The type of input a and its zeropoint.<br/> <tt>T2 : tensor(int8), tensor(uint8), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz)</tt> — The type of input b and its zeropoint.<br/> <tt>T3 : tensor(int8), tensor(uint8), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz)</tt> — The type of the output and its zeropoint.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_9b5b047e-0c7d-b970-8ff9-e09548e4bda3"><p id="_c7b549fd-8605-5bf4-3a12-5634971af1d4">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_b075f573-d493-a2ee-d7af-b5e42b10ee49"><p id="_a9bd3467-91f2-1095-385b-ccc505f4b108">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_ddb8f6fc-1685-91c9-3837-4db114f01a15" anchor="op-ai-onnx-default-quantizelinear" obligation="normative">
<title id="_7a19ae29-fad8-f8ef-0ff8-96e6c9b6a932">QuantizeLinear</title>
<p id="_d653113e-4563-66af-ae03-9b1aa99f2147">The linear quantization operator consumes a high-precision tensor, a scale, and a zero point to compute the low-precision/quantized tensor. The scale factor and zero point must have the same shape, determining the quantization granularity. The quantization formula is  <tt>y = saturate((x / y_scale) + y_zero_point)</tt>.</p>

<p id="_94aa4d5a-95b4-7228-5325-4e41e31a15e3">Saturation is done according to:</p>

<ul id="_fe55d3ae-2140-13c2-4f8c-45f029563f56"><li><p id="_4095b89d-a216-37ef-9d75-851f04184d8a">uint16: [0, 65535]</p>
</li>
<li><p id="_20f17b03-a2aa-405b-387d-d51f6e1813c3">int16: [-32768, 32767]</p>
</li>
<li><p id="_6506415c-443b-0c21-1e7c-256126a82eca">uint8: [0, 255]</p>
</li>
<li><p id="_2f77f075-0ea3-0e18-715b-e73cb1c1ce90">int8: [-128, 127]</p>
</li>
<li><p id="_f983df34-e7b5-6bf5-2dac-5ff23aa938f3">uint4: [0, 15]</p>
</li>
<li><p id="_4626442a-6726-ba2a-64fa-a2770b1f64bd">int4: [-8, 7]</p>
</li>
<li><p id="_6a66fd26-8689-9a1c-922e-f8748a90f735">uint2: [0, 3]</p>
</li>
<li><p id="_6773f4f6-ff82-d0f2-6e22-567e8f46c283">int2: [-2, 1]</p>
</li>
</ul>

<p id="_96d24673-7e35-b6a4-631b-c82df65d6c25">For <tt>(x / y_scale)</tt>, it rounds to the nearest even. Refer to <link target="https://en.wikipedia.org/wiki/Rounding"/> for details.</p>

<p id="_65075cb9-f70e-675a-a16c-1abacd6eb1a2"><tt>y_zero_point</tt> and <tt>y</tt> must have the same type. <tt>y_zero_point</tt> is usually not used for quantization to float8 and 4bit types, but the quantization formula remains the same for consistency, and the type of the attribute  <tt>y_zero_point</tt> still determines the quantization type. <tt>x</tt> and <tt>y_scale</tt> are allowed to have different types. The type of <tt>y_scale</tt> determines the precision of the division operation between <tt>x</tt> and <tt>y_scale</tt>, unless the <tt>precision</tt> attribute is specified.</p>

<p id="_fe014b19-0fba-9f13-4e0c-737e0e8ea7a5">There are three supported quantization granularities, determined by the shape of <tt>y_scale</tt>. In all cases,  <tt>y_zero_point</tt> must have the same shape as <tt>y_scale</tt>.</p>

<ul id="_a1ed1eaf-d53c-1b77-af50-bf857b40fbad"><li><p id="_510082ec-bb71-b831-6de0-9d9b94831eda">Per-tensor (per-layer) quantization: <tt>y_scale</tt> is a scalar.</p>
</li>
<li><p id="_dcafad18-a006-1e3d-1924-5fcbb1c6a23a">Per-axis quantization: The scale must be a 1-D tensor, with the length of the quantization axis. For an input shape <tt>(D0, ..., Di, ..., Dn)</tt> and <tt>axis=i</tt>, <tt>y_scale</tt> is a 1-D tensor of length <tt>Di</tt>.</p>
</li>
<li><p id="_522141bc-35f8-15b5-108d-1fc7db4dbcb1">Blocked quantization: The scale’s shape is identical to the input’s shape, except for one dimension, in which blocking is performed. Given  <tt>x</tt> shape <tt>(D0, ..., Di, ..., Dn)</tt>, <tt>axis=i</tt>, and block size <tt>B</tt>: <tt>y_scale</tt> shape is <tt>(D0, ..., ceil(Di/B), ..., Dn)</tt>.</p>
<dl id="_e957f301-ecd6-aa8b-363d-794cfba7f253"><dt>Domain</dt>
<dd id="_67119f57-9303-5377-9cfc-86c0ad2585d5"><p id="_1798c348-3b0e-8bcc-4cd9-1e4fabc031e2"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_eb5ea1eb-b956-1a7e-af57-ffe9814f11d9"><p id="_9375fac6-c8f2-e990-6db2-212ae608c7ef">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_dcb16cb1-264b-5721-0547-6e8a9384123e"><p id="_b2a48d96-3cd2-bbd1-f88d-81d842b02542">10, 13, 19, 21, 23, 24, 25</p>
</dd>
<dt>Inputs (2 — 3)</dt>
<dd id="_a9ee558d-169b-e2c0-0fe4-824d9fcfc10c"><p id="_0157fe0e-148c-7b1a-d2a6-32f6fe29ddd8"><tt>x : T1</tt> — N-D full precision Input tensor to be quantized.<br/> <tt>y_scale : T2</tt> — Scale for doing quantization to get <tt>y</tt>. For per-tensor/layer quantization the scale is a scalar, for per-axis quantization it is a 1-D Tensor and for blocked quantization it has the same shape as the input, except for one dimension in which blocking is performed.<br/> <tt>y_zero_point (optional) : T3</tt> — Zero point for doing quantization to get <tt>y</tt>. Shape must match <tt>y_scale</tt>. Default is uint8 with zero point of 0 if it’s not specified.</p>
</dd>
<dt>Outputs</dt>
<dd id="_f5e96deb-bd0b-312e-eaaa-e055dd3a7bc3"><p id="_c6f8294d-b4cc-5f29-fb3e-a251ea0d1225"><tt>y : T3</tt> — N-D quantized output tensor. It has same shape as input <tt>x</tt>.</p>
</dd>
<dt>Attributes</dt>
<dd id="_01572e82-a4f4-7ad2-a2f4-5b9f4fccf252"><p id="_c44b66cf-37b5-3625-cfb9-2d2d7ec7ee2a"><tt>axis : int (default is 1)</tt> — (Optional) The axis of the dequantizing dimension of the input tensor. Used only for per-axis and blocked quantization. Negative value means counting dimensions from the back. Accepted range is <tt>[-r, r-1]</tt> where <tt>r = rank(input)</tt>. When the rank of the input is 1, per-tensor quantization is applied, rendering the axis unnecessary in this scenario.<br/> <tt>block_size : int (default is 0)</tt> — (Optional) The size of the quantization block (number of times every scale is replicated). Used only for blocked quantization. The block size is a positive integer. Given <tt>x</tt> shape <tt>(D0, ..., Di, ..., Dn)</tt>, <tt>y_scale</tt> shape <tt>(S0, ... Si, ...Sn)</tt> and <tt>axis=i</tt>, the accepted range is <tt>[ceil(Di/Si), ceil(Di/(Si-1))-1]</tt><br/> <tt>output_dtype : int (default is 0)</tt> — (Optional) The output data type. If not supplied, the output data type is inferred from <tt>y_zero_point</tt> data type (<tt>T3</tt>). If neither <tt>output_dtype</tt> nor <tt>y_zero_point</tt> are supplied, output data type is uint8. If both <tt>output_dtype</tt> and <tt>y_zero_point</tt> are specified, <tt>output_dtype</tt> must be <tt>T3</tt>.<br/> <tt>precision : int (default is 0)</tt> — (Optional) The precision of the division operation between <tt>x</tt> and <tt>y_scale</tt>. If not provided, it will be the same as the type of <tt>y_scale</tt>.<br/> <tt>saturate : int (default is 1)</tt> — The parameter defines how the conversion behaves if an input value is out of range of the destination type. It only applies for float 8 quantization (float8e4m3fn, float8e4m3fnuz, float8e5m2, float8e5m2fnuz). It is true by default. All cases are fully described in two tables inserted in the operator description. It has no effect for float4e2m1, float6e2m3, or float6e3m2, since those types have no non-saturating (infinity-representable) encoding to fall back to.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_b2bda3ce-b523-71ad-56ae-7569890d3969"><p id="_4537eb04-99f9-e520-c57f-ecd68864ca9b"><tt>T1 : tensor(float), tensor(float16), tensor(bfloat16), tensor(int32)</tt> — The type of the input ‘x’.<br/> <tt>T2 : tensor(float), tensor(float16), tensor(bfloat16), tensor(int32), tensor(float8e8m0)</tt> — The type of the input ‘y_scale’.<br/> <tt>T3 : tensor(int8), tensor(uint8), tensor(int16), tensor(uint16), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(uint2), tensor(int2), tensor(float6e2m3), tensor(float6e3m2)</tt> — The type of the input <tt>y_zero_point</tt> and the output <tt>y</tt>.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_7b54aa69-4f17-314b-094d-e3b975628627"><p id="_ccc763e0-1cbd-d563-059a-a6f2e0721717"><tt>test_quantizelinear_axis</tt>, <tt>test_quantizelinear_blocked_asymmetric</tt>, <tt>test_quantizelinear_blocked_symmetric</tt>, <tt>test_quantizelinear_e4m3fn</tt>, <tt>test_quantizelinear_e5m2</tt>, <tt>test_quantizelinear_float4e2m1</tt>, <tt>test_quantizelinear_int16</tt>, <tt>test_quantizelinear_int2</tt>, <tt>test_quantizelinear_int4</tt>, <tt>test_quantizelinear</tt>, <tt>test_quantizelinear_uint16</tt>, <tt>test_quantizelinear_uint2</tt>, <tt>test_quantizelinear_uint4</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_cc7e87a7-17f4-ad8c-c5fb-5c32ebbe3358"><p id="_db28aa7d-bf21-f33d-03df-41cde2e08f48">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</li>
</ul>
</clause>

<clause id="_d33be623-17d3-3288-4d85-0191af974505" anchor="op-ai-onnx-default-rmsnormalization" obligation="normative">
<title id="_9acddb96-4f95-c763-e332-395395f5a55f">RMSNormalization</title>
<p id="_b064da6d-b1b6-5ed6-4263-cf24491f778a">This is RMS normalization defined in ONNX as function as described in the paper <link target="https://arxiv.org/pdf/1910.07467"/>.       The overall computation can be split into two stages. The root mean squared norm is taken over the last D dimensions,       where D is the dimension of normalized_shape. For example, if normalized_shape is (3, 5) (a 2-dimensional shape),       the rms norm is computed over the last 2 dimensions of the input. The computation required by standardization can be       described by the following equations.       `       XSquared = Mul(X, X)       XSquaredMean =  <tt>ReduceMean&lt;axes=normalized_axes&gt;</tt>(XSquared)       MeanSquareEpsilon = Add(XSquaredMean, epsilon)       RMS = Sqrt(MeanSquareEpsilon)       Normalized = Div(X, RMS)      `       where  <tt>normalized_axes</tt> is <tt>[axis, ..., rank of X - 1]</tt>. The variables <tt>RMS</tt> stand for root mean square,       Depending on  <tt>stash_type</tt> attribute, the actual computation       must happen in different floating-point precision.       For example, if  <tt>stash_type</tt> is 1, this operator casts       all input variables to 32-bit float, perform the computation, and       finally cast  <tt>Normalized</tt> back to the original type of <tt>X</tt>.       The second stage then scales the outcome of the first stage using:       `       Y= Mul(Normalized, Scale)      `       Let  <tt>d[i]</tt> indicate the i-th dimension of <tt>X</tt>.       If  <tt>X</tt>‘s shape is <tt>[d[0], ..., d[axis-1], d[axis], ..., d[rank-1]]</tt>,       the shape of  <tt>RMS</tt> is <tt>[d[0], ..., d[axis-1], 1, ..., 1]</tt>.        <tt>Y</tt> and <tt>X</tt> have the same shape. This operator supports unidirectional broadcasting       (<tt>Scale</tt> should be unidirectional broadcastable to tensor <tt>X</tt>);       for more details please check the doc.</p>

<dl id="_6934e60d-ace3-b39c-7c99-6d5cf7b7c74c"><dt>Domain</dt>
<dd id="_fd4aa974-91a8-391d-ccad-9a7bb297766c"><p id="_3a6c1bb3-dddb-4b06-fd32-8d31a4ecf920"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_73f86745-d191-1bb7-ddc5-86beb77efd67"><p id="_efa7869b-e886-f0a8-aa34-a3b7b82574ba">23</p>
</dd>
<dt>Inputs</dt>
<dd id="_5793fcd7-e55a-1fbb-421a-140d54ffec46"><p id="_3bef8bb4-2c67-49dc-8c3e-ab709b50558f"><tt>X : T</tt> — The input tensor to be normalized. In general, the shape is (D1, D2, …​ , Dn) for n-dimensional data, where the root mean squared norm is taken over the last D dimensions, D is determined by the axis attribute.<br/> <tt>scale : V</tt> — Scale tensor. Scale tensor shape should be broadcastable to the normalized shape.</p>
</dd>
<dt>Outputs</dt>
<dd id="_15ec4ec4-7d06-4a42-115f-e0e38fa80f9d"><p id="_172ac0c4-68ec-cb7f-aef0-5c5a6f123f99"><tt>Y : V</tt> — Output data tensor. Same shape as X</p>
</dd>
<dt>Attributes</dt>
<dd id="_3e331d84-ba37-4ed4-5f88-091177ae00c0"><p id="_629d52cc-0d7b-5de7-4d13-2ebf54cac05a"><tt>axis : int (default is -1)</tt> — The first normalization dimension. If rank(X) is r, axis’ allowed range is [-r, r). Negative value means counting dimensions from the back.<br/> <tt>epsilon : float (default is 1e-05)</tt> — The epsilon value to use to avoid division by zero.<br/> <tt>stash_type : int (default is 1)</tt> — The floating-point precision used in stage one of the computation.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_f2b3d102-7582-c39a-5302-3d786d2ce1c4"><p id="_abd1001b-963a-b7da-064e-4fe11ca1337c"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input X type to float tensors.<br/> <tt>V : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain output Y and scale type to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_87511ec4-9e8f-a682-55fd-c70cda3bd0be"><p id="_86176214-19c0-d447-5b34-f05a701aa99a"><tt>test_rms_normalization_default_axis</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_fd4eaeb9-fecf-70dc-31f5-9180ff630e7b"><p id="_f96b8bdf-70ad-3686-107a-bc20d756af67">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_1af07659-5c4b-98ba-7f28-6ed12f0fa572" anchor="op-ai-onnx-default-rnn" obligation="normative">
<title id="_20ad5888-c023-4bd1-6653-26d5651d8d25">RNN</title>
<p id="_9ac956d7-1bbf-2215-b4a0-5115f72e74a5">Computes an one-layer simple RNN. This operator is usually supported via some custom implementation such as CuDNN.</p>

<p id="_ef345cb6-eb00-05c7-e6f7-a41d4b307647">Notations:</p>

<ul id="_a58baf93-c51a-baef-9816-aa2cd9d4e7a6"><li><p id="_27167ce1-ee15-3a64-260f-1e7fb24cc19b"><tt>X</tt> — input tensor</p>
</li>
<li><p id="_f847c1ba-4266-4ac2-7ec0-57998409ba0b"><tt>i</tt> — input gate</p>
</li>
<li><p id="_b175af76-1af7-dcc9-32fb-07fd54fb11e4"><tt>t</tt> — time step (t-1 means previous time step)</p>
</li>
<li><p id="_fb525936-9ea6-90e0-7ff4-5272e3532b67"><tt>Wi</tt> — W parameter weight matrix for input gate</p>
</li>
<li><p id="_63c777fd-d9f0-f43d-602b-28d849d7209a"><tt>Ri</tt> — R recurrence weight matrix for input gate</p>
</li>
<li><p id="_ad8f2a4b-fd3d-528c-efcc-ebdf0a106af9"><tt>Wbi</tt> — W parameter bias vector for input gate</p>
</li>
<li><p id="_b0842a7e-43f6-9fca-a2a9-d5322a4f6787"><tt>Rbi</tt> — R parameter bias vector for input gate</p>
</li>
<li><p id="_0ecbb012-3f2e-c9ba-85a1-e7fd58188130"><tt>WBi</tt> — W parameter weight matrix for backward input gate</p>
</li>
<li><p id="_44c3135b-063e-16b6-f3d6-fb4fc1265cb6"><tt>RBi</tt> — R recurrence weight matrix for backward input gate</p>
</li>
<li><p id="_1bec980a-51bf-5d07-a71c-0714918820e3"><tt>WBbi</tt> — WR bias vectors for backward input gate</p>
</li>
<li><p id="_56cbd5d3-6f1f-03a0-df7b-5c8657cf40eb"><tt>RBbi</tt> — RR bias vectors for backward input gate</p>
</li>
<li><p id="_02bb3bcd-55a3-2924-a6f3-14e4c69f33d2"><tt>H</tt> — Hidden state</p>
</li>
<li><p id="_15a8f4df-ca84-d08c-bf2d-6f2757b7881e"><tt>num_directions</tt> — 2 if direction == bidirectional else 1</p>
</li>
</ul>

<p id="_bd5d216e-f69e-9c50-96b8-39a7560f15ce">Activation functions:</p>

<ul id="_13e1d4ea-1a9b-e219-6e6b-1188eefa91fa"><li><p id="_2cbf18cd-2d0d-e0ae-c284-a6ce2fd12a6b">Relu(x)                — max(0, x)</p>
</li>
<li><p id="_ffed4c3c-c8db-958e-b03f-f923c8bdb467">Tanh(x)                — (1 — e^{-2x})/(1 + e^{-2x})</p>
</li>
<li><p id="_bec42b8a-2745-580c-b68c-7a9e1fad48bc">Sigmoid(x)             — 1/(1 + e^{-x})</p>
</li>
<note id="_01a42ccc-aaaa-b36c-e4fb-c7333c8a5037"><p id="_86122724-8657-5051-312a-db8bfc1e45df">Below are optional</p>
</note></ul>



<ul id="_8261b041-ece3-a54a-1250-965c61481136"><li><p id="_0cdb3d2e-2247-d86f-3918-dfd7b306c8d7">Affine(x)              — alpha*x + beta</p>
</li>
<li><p id="_8fc16330-2e0f-ef45-53d5-38b53b09d6c2">LeakyRelu(x)           — x if x &gt;= 0 else alpha * x</p>
</li>
<li><p id="_5f43dca6-3626-312e-c13c-585209b9bfa2">ThresholdedRelu(x)     — x if x &gt;= alpha else 0</p>
</li>
<li><p id="_d21ecddb-cb24-1107-5bcf-f896ad8d621a">ScaledTanh(x)          — alpha<em>Tanh(beta</em>x)</p>
</li>
<li><p id="_8b756092-c158-8d05-129e-d9b84bf4f3c1">HardSigmoid(x)         — min(max(alpha*x + beta, 0), 1)</p>
</li>
<li><p id="_5ac32340-115e-e216-58f8-8e43cb93321d">Elu(x)                 — x if x &gt;= 0 else alpha*(e^x — 1)</p>
</li>
<li><table id="_9ee5ee67-ce9e-a24e-88b9-74418a3d4596">
<name id="_f717113f-9063-79ae-aebc-39c069a4bac2">Table from the upstream description of <tt>RNN</tt></name>
<tbody><tr id="_4a5bb968-3d7d-be81-34b3-a10705a6fc04"><td id="_c190e537-ed95-606a-0c43-9d0071850ebc" valign="top" align="left">Softsign(x)            — x/(1<br/></td>
<td id="_932abce1-e666-cc93-e0b9-cce228f05118" valign="top" align="left">x</td>
<td id="_bfc9ecae-2e5a-9868-acd9-ff36c55f3ae4" valign="top" align="left">)</td>
</tr></tbody>
</table>
</li>
<li><p id="_fdfbcdc6-1de3-18cf-29dc-93d4305e72f0">Softplus(x)            — log(1 + e^x)</p>
</li>
</ul>

<p id="_c972f8b2-3625-1596-eb67-9686a2826ff3">Equations (Default: f=Tanh):</p>

<ul id="_506bad83-e789-7a76-754a-7c7d95709f9d"><li><p id="_4c61d342-4c43-c8f5-df72-68980c9dd5b8">Ht = f(Xt<em>(Wi^T) + Ht-1</em>(Ri^T) + Wbi + Rbi) This operator has  <strong>optional</strong> inputs/outputs. See the doc for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument’s name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.</p>
<dl id="_c830775b-3671-8cab-e76c-d67b4fbd0008"><dt>Domain</dt>
<dd id="_6d697300-3cf2-9378-beeb-257622cf3130"><p id="_1fb248cb-0e33-c019-2ebd-b2fa844252f7"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_ff4b122e-0440-9fac-0fc1-7a89c4e570ba"><p id="_bb792730-4ab4-15e8-1f0a-2c1f582c314f">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_d86fe982-aa56-92c9-5b78-5efd99378bfc"><p id="_a798c307-a2ce-d54a-ccd2-3058c36721d0">1, 7, 14</p>
</dd>
<dt>Inputs (3 — 6)</dt>
<dd id="_6734f2b6-d7dd-c021-93d3-007e18e1030d"><p id="_5eb74bc0-668d-61ca-0e0b-6597e139c2dd"><tt>X (differentiable) : T</tt> — The input sequences packed (and potentially padded) into one 3-D tensor with the shape of <tt>[seq_length, batch_size, input_size]</tt>.<br/> <tt>W (differentiable) : T</tt> — The weight tensor for input gate. Concatenation of <tt>Wi</tt> and <tt>WBi</tt> (if bidirectional). The tensor has shape <tt>[num_directions, hidden_size, input_size]</tt>.<br/> <tt>R (differentiable) : T</tt> — The recurrence weight tensor. Concatenation of <tt>Ri</tt> and <tt>RBi</tt> (if bidirectional). The tensor has shape <tt>[num_directions, hidden_size, hidden_size]</tt>.<br/> <tt>B (optional, differentiable) : T</tt> — The bias tensor for input gate. Concatenation of <tt>[Wbi, Rbi]</tt> and <tt>[WBbi, RBbi]</tt> (if bidirectional). The tensor has shape <tt>[num_directions, 2*hidden_size]</tt>. Optional: If not specified — assumed to be 0.<br/> <tt>sequence_lens (optional, non-differentiable) : T1</tt> — Optional tensor specifying lengths of the sequences in a batch. If not specified — assumed all sequences in the batch to have length <tt>seq_length</tt>. It has shape <tt>[batch_size]</tt>.<br/> <tt>initial_h (optional, non-differentiable) : T</tt> — Optional initial value of the hidden. If not specified — assumed to be 0. It has shape <tt>[num_directions, batch_size, hidden_size]</tt>.</p>
</dd>
<dt>Outputs (0 — 2)</dt>
<dd id="_331be1a0-7006-b34d-f5ef-67f511071319"><p id="_9aec8939-a9bc-979d-356d-6db920df553f"><tt>Y (optional, differentiable) : T</tt> — A tensor that concats all the intermediate output values of the hidden. It has shape <tt>[seq_length, num_directions, batch_size, hidden_size]</tt>.<br/> <tt>Y_h (optional, differentiable) : T</tt> — The last output value of the hidden. It has shape <tt>[num_directions, batch_size, hidden_size]</tt>.</p>
</dd>
<dt>Attributes</dt>
<dd id="_245210ea-6988-7eeb-e05f-308638008d42"><p id="_25f24997-d1a9-8eca-89b0-c791428a8bc2"><tt>activation_alpha : list of floats</tt> — Optional scaling values used by some activation functions. The values are consumed in the order of activation functions, for example (f, g, h) in LSTM. Default values are the same as of corresponding ONNX operators.For example with LeakyRelu, the default alpha is 0.01.<br/> <tt>activation_beta : list of floats</tt> — Optional scaling values used by some activation functions. The values are consumed in the order of activation functions, for example (f, g, h) in LSTM. Default values are the same as of corresponding ONNX operators.<br/> <tt>activations : list of strings (default is ['Tanh', 'Tanh'])</tt> — One (or two if bidirectional) activation function for input gate. The activation function must be one of the activation functions specified above. Optional: Default <tt>Tanh</tt> if not specified.<br/> <tt>clip : float</tt> — Cell clip threshold. Clipping bounds the elements of a tensor in the range of [-threshold, +threshold] and is applied to the input of activations. No clip if not specified.<br/> <tt>direction : string (default is forward)</tt> — Specify if the RNN is forward, reverse, or bidirectional. Must be one of forward (default), reverse, or bidirectional.<br/> <tt>hidden_size : int</tt> — Number of neurons in the hidden layer<br/> <tt>layout : int (default is 0)</tt> — The shape format of inputs X, initial_h and outputs Y, Y_h. If 0, the following shapes are expected: X.shape = [seq_length, batch_size, input_size], Y.shape = [seq_length, num_directions, batch_size, hidden_size], initial_h.shape = Y_h.shape = [num_directions, batch_size, hidden_size]. If 1, the following shapes are expected: X.shape = [batch_size, seq_length, input_size], Y.shape = [batch_size, seq_length, num_directions, hidden_size], initial_h.shape = Y_h.shape = [batch_size, num_directions, hidden_size].</p>
</dd>
<dt>Type constraints</dt>
<dd id="_081f3a73-4892-dfd2-7eb9-5bb2be7c57eb"><p id="_1c6d3b52-8004-a923-8e7d-2e5313aa178e"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.<br/> <tt>T1 : tensor(int32)</tt> — Constrain seq_lens to integer tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_a0b2af4c-e56c-7d36-d95d-65f2c088da05"><p id="_0b1d6a9d-f53f-0103-3415-18b8e0d89cef"><tt>test_simple_rnn_batchwise</tt>, <tt>test_simple_rnn_bidirectional</tt>, <tt>test_simple_rnn_defaults</tt>, <tt>test_simple_rnn_with_initial_bias</tt>, <tt>test_simple_rnn_reverse</tt>, <tt>test_rnn_seq_length</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_a5d3693c-6803-fb06-2fbb-d47403f18871"><p id="_0c47ad93-0f99-9b9c-c3d9-c1bf9e7ea886">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</li>
</ul>
</clause>

<clause id="_2ffe6d3b-e193-5b4f-f2e7-28f857de0776" anchor="op-ai-onnx-default-randomnormal" obligation="normative">
<title id="_34d480b5-a5b6-4c31-ca06-c46163b624fa">RandomNormal</title>
<p id="_f79d0cd5-c22d-4340-1cc3-c4005adf2443">Generate a tensor with random values drawn from a normal distribution. The shape of the tensor is specified by the  <tt>shape</tt> argument and the parameter of the normal distribution specified by  <tt>mean</tt> and <tt>scale</tt>.</p>

<p id="_fe0e7b3d-eeae-37c8-5b11-26d7f1f423d5">The data type is specified by the ‘dtype’ argument. The ‘dtype’ argument must be one of the data types specified in the ‘DataType’ enum field in the TensorProto message.</p>

<dl id="_c340d975-3d7b-252f-e95e-cd4a476fc677"><dt>Domain</dt>
<dd id="_0339387c-7342-0918-ae3b-a9beb4c94ad2"><p id="_15707bda-4198-dcd5-aa2c-4bdbecf43b22"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_a7ed3d25-e698-edde-de7b-9d08e97ee415"><p id="_cd192f66-649a-ef2f-c80e-6be9f5b4e98c">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_a5bc3c9a-3b12-3068-6041-d01210dc26aa"><p id="_e3f7a2f4-65a6-78d0-de19-bc8e73d1fe12">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_6d4bbbd6-a4d4-b74d-7af3-cb00b6893d37"><p id="_46dffca0-c3d5-ae24-f713-ccd006cc7095">None.</p>
</dd>
<dt>Outputs</dt>
<dd id="_615a5c82-4277-0768-6b08-6ba806dd18b2"><p id="_44294d9b-9359-471d-5ff5-3c18bc1e58ac"><tt>output : T</tt> — Output tensor of random values drawn from normal distribution</p>
</dd>
<dt>Attributes</dt>
<dd id="_4d24354c-e875-6c93-1f19-88382dc82263"><p id="_0d316cf3-212e-a270-abad-660b47ebf662"><tt>dtype : int (default is 1)</tt> — The data type for the elements of the output tensor. Default is TensorProto::FLOAT.<br/> <tt>mean : float (default is 0.0)</tt> — The mean of the normal distribution.<br/> <tt>scale : float (default is 1.0)</tt> — The standard deviation of the normal distribution.<br/> <tt>seed : float</tt> — (Optional) Seed to the random generator, if not specified we will auto generate one.<br/> <tt>shape : list of ints (required)</tt> — The shape of the output tensor.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_879e5fed-1f5f-43fa-5952-f9526bf6834d"><p id="_62b419a0-4000-a5d9-abba-30a1cd622be5"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_a230df71-86b2-1a62-c27d-360a7dc8f221"><p id="_8a6aebc1-6f95-37a7-7670-76bc7eb2bd21">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_4854b88b-0a58-b0e8-0316-9c2554c3ffaa"><p id="_b015299e-32a0-1e37-0ccb-03819c576146">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_cb741272-4c74-c151-80eb-452750187948" anchor="op-ai-onnx-default-randomnormallike" obligation="normative">
<title id="_c2b3a982-3c0a-f9c7-7b20-3a4f664b611d">RandomNormalLike</title>
<p id="_f5374f0f-1d9b-9e72-80b1-d0a46fdcc1f9">Generate a tensor with random values drawn from a normal distribution. The shape of the output tensor is copied from the shape of the input tensor, and the parameters of the normal distribution are specified by  <tt>mean</tt> and <tt>scale</tt>.</p>

<p id="_135544b2-3283-7635-bf70-4030898d5705">The data type is specified by the ‘dtype’ argument, or copied from the input tensor if not provided. The ‘dtype’ argument must be one of the data types specified in the ‘DataType’ enum field in the TensorProto message, and be valid as an output type.</p>

<dl id="_ef29fcdd-d8a3-68e2-14c5-f5514b22a785"><dt>Domain</dt>
<dd id="_83be0a9f-1774-d53d-3edf-cdaa920fb6de"><p id="_d4e34b0f-fb33-85b2-ec32-4b8c5e8dfbee"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_f8dc87a5-c014-80f5-5488-9ab600b50561"><p id="_2915d3ed-8d8e-aedf-0a5f-1cc24c28097e">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_183e957c-a1b6-b47e-e447-d363d7d6265d"><p id="_ad6b8e45-f5f0-8515-91c7-5ce0ac82999d">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_b65a6a38-c67c-a786-3eb0-63d76952796d"><p id="_79402ac4-51b8-f05f-ea7a-c07e7353c572"><tt>input : T1</tt> — Input tensor to copy shape and optionally type information from.</p>
</dd>
<dt>Outputs</dt>
<dd id="_d6bcd7dc-fd7f-3f6b-67f8-1411bea8e5bf"><p id="_d44099d7-d303-a3f7-5a13-f2961c74bd5c"><tt>output : T2</tt> — Output tensor of random values drawn from normal distribution</p>
</dd>
<dt>Attributes</dt>
<dd id="_eae2c903-b8a8-15d6-7a02-c9a4e96da42e"><p id="_fdd5e555-116f-40d5-89fa-6be2a884a81d"><tt>dtype : int</tt> — (Optional) The data type for the elements of the output tensor, if not specified, we will use the data type of the input tensor.<br/> <tt>mean : float (default is 0.0)</tt> — The mean of the normal distribution.<br/> <tt>scale : float (default is 1.0)</tt> — The standard deviation of the normal distribution.<br/> <tt>seed : float</tt> — (Optional) Seed to the random generator, if not specified we will auto generate one.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_729a3ec7-67fe-3279-aac4-8f23971bd861"><p id="_2ba91ac8-c68e-3d6c-5106-46b98ebd5f77"><tt>T1 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain to any tensor type. If the dtype attribute is not provided this must be a valid output type.<br/> <tt>T2 : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_d1296bd0-ebe5-bdb6-e164-1d97648935b3"><p id="_b02fefae-c0c1-e0fa-98cd-a753ff47a182">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_2aa77b3a-1836-994b-467a-cd9443d5312e"><p id="_1c2b604d-c30c-d817-102f-f29fc0b5b46e">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_d02e8487-acd4-5d21-0ad9-4d7b743f57f9" anchor="op-ai-onnx-default-randomuniform" obligation="normative">
<title id="_d174e6f6-4e0b-469b-c405-0440076ace02">RandomUniform</title>
<p id="_817c604c-19cc-81b3-cb82-fafbb34398eb">Generate a tensor with random values drawn from a uniform distribution. The shape of the tensor is specified by the  <tt>shape</tt> argument and the range by <tt>low</tt> and <tt>high</tt>.</p>

<p id="_1cdb8290-182a-1b1e-9681-69d2ced950a9">The data type is specified by the ‘dtype’ argument. The ‘dtype’ argument must be one of the data types specified in the ‘DataType’ enum field in the TensorProto message.</p>

<dl id="_d0ef19db-27c6-10f5-10f2-efde56c3442b"><dt>Domain</dt>
<dd id="_840045f4-b015-a750-d5df-51b2377df234"><p id="_a954fbb6-3147-a639-4e6b-03efd4039618"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_3cac7923-2cf1-70ab-bf85-45ddbb61b8fc"><p id="_96755180-2fad-728c-3851-4b8c8cc7e05a">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_44b34044-1593-b47c-e55b-0d4bb915e7e6"><p id="_23fe38d1-b5b9-4b99-48ae-0e26e6556372">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_d04f2d67-9b89-e37b-155f-3aeb56afd201"><p id="_c19a6606-5730-4094-43ab-357fd6fe79b2">None.</p>
</dd>
<dt>Outputs</dt>
<dd id="_27271eb1-e070-80a6-50f3-802fd0cc5741"><p id="_e8b8d42b-c230-ca5f-a439-c67fdc07770b"><tt>output : T</tt> — Output tensor of random values drawn from uniform distribution</p>
</dd>
<dt>Attributes</dt>
<dd id="_15b5eb86-08bf-7a44-b266-44dfe6ce9eb1"><p id="_d9df1f6f-f463-559d-e5a0-25c07ceaf0a8"><tt>dtype : int (default is 1)</tt> — The data type for the elements of the output tensor. If not specified, default is TensorProto::FLOAT.<br/> <tt>high : float (default is 1.0)</tt> — Upper boundary of the output values.<br/> <tt>low : float (default is 0.0)</tt> — Lower boundary of the output values.<br/> <tt>seed : float</tt> — (Optional) Seed to the random generator, if not specified we will auto generate one.<br/> <tt>shape : list of ints (required)</tt> — The shape of the output tensor.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_fa5f7c2e-067d-6891-56d4-603f1b8feb21"><p id="_ec65ebf8-ac3d-947c-7c99-233bf296e2d5"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_2ec0ad4e-93ee-0866-3d5e-11f3e0bfc685"><p id="_2ab0cd1f-48d1-ebd5-5353-636ee743275d">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_00420fc7-8a55-b5d8-6dcc-6449628b2362"><p id="_637a3e85-dd7e-c2c7-2fb1-099ce1f45141">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_dcc9038f-5170-4b15-2e6a-910db417afe6" anchor="op-ai-onnx-default-randomuniformlike" obligation="normative">
<title id="_e42e74b9-8a57-0303-8d0c-0339d6d07aae">RandomUniformLike</title>
<p id="_a3d53bb9-d8dc-5f07-b43e-1a1c067c02c0">Generate a tensor with random values drawn from a uniform distribution. The shape of the output tensor is copied from the shape of the input tensor, and the parameters of the uniform distribution are specified by  <tt>low</tt> and <tt>high</tt>.</p>

<p id="_596542e7-3746-dd52-9f0e-c419b7736c40">The data type is specified by the ‘dtype’ argument, or copied from the input tensor if not provided. The ‘dtype’ argument must be one of the data types specified in the ‘DataType’ enum field in the TensorProto message and be valid as an output type.</p>

<dl id="_a0c5f3ca-788e-e925-0dd8-14cd7ea5ec5b"><dt>Domain</dt>
<dd id="_35415ca9-86f1-c39e-830c-55b833bbcb2a"><p id="_1d2e0626-e532-eb6a-227d-7841d662c94d"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_b51b860e-1ca3-675f-473b-029b8215a6b6"><p id="_532aca16-7372-0b65-a1fa-94f5e2a66dc1">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_43245bce-b004-9c47-d8bf-c77b2829849d"><p id="_09a47c2a-28b3-d129-9bd3-9d1bc64333a0">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_cfb5978d-cffe-a37f-e99c-fb2e4f78891f"><p id="_7ef25d00-6c27-8c02-2e7b-44462e899a74"><tt>input : T1</tt> — Input tensor to copy shape and optionally type information from.</p>
</dd>
<dt>Outputs</dt>
<dd id="_1236a134-1065-900c-917a-51ac4dbacfa5"><p id="_bc5a1470-56ee-3e7a-eeec-cf70168af73b"><tt>output : T2</tt> — Output tensor of random values drawn from uniform distribution</p>
</dd>
<dt>Attributes</dt>
<dd id="_f7201e55-d7b4-4c25-4d9e-ce368429d29e"><p id="_b216c807-db4f-0fdf-aaec-909e5cd4a223"><tt>dtype : int</tt> — (Optional) The data type for the elements of the output tensor, if not specified, we will use the data type of the input tensor.<br/> <tt>high : float (default is 1.0)</tt> — Upper boundary of the output values.<br/> <tt>low : float (default is 0.0)</tt> — Lower boundary of the output values.<br/> <tt>seed : float</tt> — (Optional) Seed to the random generator, if not specified we will auto generate one.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_dbbdeeb3-11b6-52ae-6a21-61e667c53ca4"><p id="_20b8d074-c670-1066-cda6-5eb24f787ae1"><tt>T1 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain to any tensor type. If the dtype attribute is not provided this must be a valid output type.<br/> <tt>T2 : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_88e9ed66-1836-a6ed-480c-f7d58ff38a7f"><p id="_8c21218a-c3af-63ec-0ca0-413c4b6c1a94">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_d4ab8052-8e0f-11c0-8f64-f36383ba85cb"><p id="_ccdf51b6-2ab8-a5fa-9b4e-5fb9f0cab8ce">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_c905df3e-94f8-9a40-a9db-9dcd7ce3d8cf" anchor="op-ai-onnx-default-range" obligation="normative">
<title id="_f9d3aefe-f3a3-696e-9bf4-bd57f65f2424">Range</title>
<p id="_2a66895f-6f66-406d-9510-5a8e661fe0be">Generate a tensor containing a sequence of numbers that begin at <tt>start</tt> and extends by increments of <tt>delta</tt> up to  <tt>limit</tt> (exclusive).</p>

<p id="_34f5833f-83c8-ae2d-f9fd-b1c302adbe48">The number of elements in the output of range is computed as below:</p>

<sourcecode id="_692e6fc1-5846-9043-d7b2-adafc78eddd9" unnumbered="true"><body>number_of_elements = max( ceil( (limit - start) / delta ) , 0 )</body></sourcecode>


<p id="_50fc6d76-fa61-c50f-aaee-9125931e8bb6">The pseudocode determining the contents of the output is shown below:</p>

<sourcecode id="_ffd86a41-0391-84ba-838c-c6821bc498a7" unnumbered="true"><body>for(int i=0; i&lt;number_of_elements; ++i) {
  output[i] =  start + (i * delta);
}</body></sourcecode>


<p id="_eee1735b-7bff-e91c-4691-1bf91d0293b5">Example 1:</p>

<sourcecode id="_502c4e93-52b7-7f8c-a6ef-67b82c8ad563" unnumbered="true"><body>Inputs: start = 3, limit = 9, delta = 3
Output: [3, 6]</body></sourcecode>


<p id="_72bf1caf-561f-f3e0-b649-7ae06a8d4001">Example 2:</p>

<sourcecode id="_b3de4d8f-d6df-88e4-4ddc-76dd7ab08f07" unnumbered="true"><body>Inputs: start = 10, limit = 4, delta = -2
Output: [10, 8, 6]</body></sourcecode>


<p id="_f726f406-b093-3ff1-3e14-e0be2b44d496">For <tt>float16</tt> and <tt>bfloat16</tt> inputs, the <tt>stash_type</tt> attribute controls the precision used for intermediate accumulation. Setting  <tt>stash_type</tt> to <tt>1</tt> (float) causes <tt>start</tt>, <tt>limit</tt>, and <tt>delta</tt> to be cast to 32-bit float before the loop, with the output cast back to the original type. This avoids precision loss for large ranges where successive additions in float16 or bfloat16 would otherwise be inexact (e.g.  <tt>x + 1 == x</tt> for large <tt>x</tt>).</p>

<dl id="_30f9fde1-ac12-b209-fdcc-4e068eeac7d7"><dt>Domain</dt>
<dd id="_05047f62-209c-c210-0511-4cce31ce666f"><p id="_599a1108-dd6b-0e5d-0100-ed33a0599f3e"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_d8790118-74f1-898b-7c14-fa0aea7cd64d"><p id="_e4b3603e-a2bf-6991-e3b4-df677c26b3f1">27</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_cde44128-7fe2-c7fb-9511-5f9070c792b6"><p id="_d103de46-62ce-263c-93b4-0765691d3033">11</p>
</dd>
<dt>Inputs</dt>
<dd id="_435b21f5-5417-6ab3-e177-06946d53bcd6"><p id="_45535464-8604-7f19-78f6-880b94f98736"><tt>start : T</tt> — Scalar. First entry for the range of output values.<br/> <tt>limit : T</tt> — Scalar. Exclusive upper limit for the range of output values.<br/> <tt>delta : T</tt> — Scalar. Value to step by.</p>
</dd>
<dt>Outputs</dt>
<dd id="_af5641e7-8d2f-4a6f-481f-31499e159f93"><p id="_7cc1bc5d-4933-d369-590c-e0ea5f21ef49"><tt>output : T</tt> — A 1-D tensor with same type as the inputs containing generated range of values.</p>
</dd>
<dt>Attributes</dt>
<dd id="_9b314e58-363d-8f20-4057-4ec565a1bbfa"><p id="_8c736704-34d4-82ad-5af8-343e36f19e4f"><tt>stash_type : int (default is 1)</tt> — The data type used for intermediate computation when T is float16 or bfloat16. Defaults to 1 (float). Has no effect for other types.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_c4d46091-de87-3e08-5c35-5771d874f731"><p id="_6e3d57d9-83ea-bd3e-0b9d-7ad9fefe171f"><tt>T : tensor(float), tensor(double), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(bfloat16)</tt> — Constrain input types to common numeric type tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_4d6d5fff-51fe-c655-a684-5abcfd27e73c"><p id="_8c4b7105-0436-0186-9cd7-059cbc53fc05"><tt>test_range_bfloat16_type_positive_delta</tt>, <tt>test_range_float16_type_positive_delta</tt>, <tt>test_range_float_type_positive_delta</tt>, <tt>test_range_int32_type_negative_delta</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_314cbcd5-0fd2-d734-3293-351fad6cee06"><p id="_1980e1f7-ec49-deb0-fb5d-dbd8997478e0">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_c9acb311-06c2-5908-6576-ef7c8ad86678" anchor="op-ai-onnx-default-reciprocal" obligation="normative">
<title id="_493520ae-77bd-7272-bffd-5f24ae35681f">Reciprocal</title>
<p id="_c2cf7f0c-0fc9-1778-fa54-7062444b405c">Reciprocal takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the reciprocal is, y = 1/x, is applied to the tensor elementwise.</p>

<dl id="_9d836d53-7a69-fffd-492f-0c6adf1f186a"><dt>Domain</dt>
<dd id="_b9844951-8187-c22f-cd98-a020039770dc"><p id="_49870c15-3f91-fd6e-0595-be65fb6eda28"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_56b83f9d-d57b-8546-f98b-a564f39eaa89"><p id="_f278c010-f69a-093a-9398-295c381ed2a3">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_edb0c7f6-3ed6-b040-5f43-9bfd0269d1e0"><p id="_f487d430-4af7-00c4-e7fa-d56d6a2f2316">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_63792141-6ccb-f541-4207-e0089eaac027"><p id="_6935ef7a-d96a-79cb-3ac8-a94d9391211d"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_791447d3-edfd-e278-c49a-d7851d19f983"><p id="_8c92150c-5a61-4be5-b5eb-f5f794d6e106"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_7ee75e76-5939-3f22-c1a2-402a474179b6"><p id="_1920c55a-82f6-cb18-854e-c1a71fbcf987">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_4e8cd376-bf21-c70f-4113-152b99bf48bf"><p id="_e62b79f4-aa32-cb3f-e93c-198afccfa075"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_c4ca77e2-801f-3a8e-2034-3ea008b99ca9"><p id="_d10960c7-3bbe-38cb-8257-1d116f8625d7"><tt>test_reciprocal_example</tt>, <tt>test_reciprocal</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_e05c423f-3017-b368-bd67-87735663268d"><p id="_389a4206-5c52-59b6-e833-6daf26f29eee">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_0a23fa9b-2e49-551b-87ef-7534915fbe31" anchor="op-ai-onnx-default-reducel1" obligation="normative">
<title id="_62329c9b-e824-21e1-282a-b1134a326afb">ReduceL1</title>
<p id="_ff494b16-c2ee-7401-3deb-5c1e757bffe3">Computes the L1 norm of the input tensor’s elements along the provided axes. The resulting tensor has the same rank as the input if  <tt>keepdims</tt> equals 1. If <tt>keepdims</tt> equals 0, then the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are valid. Reduction over an empty set of values yields 0.</p>

<p id="_146869e8-2dc7-5b26-c53d-4e054f962fca">The above behavior is similar to numpy, with the exception that numpy defaults <tt>keepdims</tt> to  <tt>False</tt> instead of <tt>True</tt>.</p>

<dl id="_f4040d31-18dc-2bb6-7faa-440946986be5"><dt>Domain</dt>
<dd id="_772dc21c-c95c-2473-a1db-120cbc5e7de0"><p id="_4312cf50-3a3f-877d-8e55-50f7ef82aba1"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_c191adcd-6c44-01fd-cafc-7c068c536167"><p id="_eb7e28e3-101b-36ad-7bdc-4bc411b05827">18</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_fbbcf4bc-7802-d05c-e7dd-6a6a97826c15"><p id="_1f7a378c-8474-0471-aab7-0f534fce5892">1, 11, 13</p>
</dd>
<dt>Inputs (1 — 2)</dt>
<dd id="_c098edbd-6514-6d3d-5f0f-ed0b466e1b91"><p id="_4c245c38-1f20-3734-dde6-389fac51c35e"><tt>data (differentiable) : T</tt> — An input tensor.<br/> <tt>axes (optional, non-differentiable) : tensor(int64)</tt> — Optional input list of integers, along which to reduce. The default is to reduce over empty axes. When axes is empty (either not provided or explicitly empty), behavior depends on ‘noop_with_empty_axes’: reduction over all axes if ‘noop_with_empty_axes’ is false, and reduction over the empty set of axes when ‘noop_with_empty_axes’ is true. Accepted range is [-r, r-1] where r = rank(data).</p>
</dd>
<dt>Outputs</dt>
<dd id="_6fbdd319-940e-be73-e2bc-b2bd532a0fee"><p id="_618a3cf2-818d-87b2-d1c9-bb35854cde0d"><tt>reduced (differentiable) : T</tt> — Reduced output tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_bc6dc12d-4ed3-a729-03cc-be3c82908497"><p id="_b322b6e3-b8fd-2087-33db-cb8d418ac358"><tt>keepdims : int (default is 1)</tt> — Keep the reduced dimension or not, default 1 means keep reduced dimension.<br/> <tt>noop_with_empty_axes : int (default is 0)</tt> — Defines behavior when axes is not provided or is empty. If false (default), reduction happens over all axes (similar to the case when <tt>axis=None</tt> in numpy). If true, reduction happens over an empty set of axes (similar to the case when <tt>axis=()</tt> in numpy). Note that reduction over an empty set of axes means that the reduction step behaves like a no-op (identity function), but composite-reduction operators will still perform the non-reduction steps as needed. Thus, ReduceLogSum returns the Log of input tensor, and ReduceSumSquare returns the Square of the input tensor, in this case.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_f75eda95-3f7e-0ba4-69d2-f558ba9ca364"><p id="_52d0b978-ad37-9272-0f25-9e999d6ffeb7"><tt>T : tensor(uint32), tensor(uint64), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_f5863cdc-18e3-848b-0442-25fca27a7ab9"><p id="_6cb33720-ea6d-9cd2-6d0c-36bc18f65d84"><tt>test_reduce_l1_default_axes_keepdims_example</tt>, <tt>test_reduce_l1_default_axes_keepdims_random</tt>, <tt>test_reduce_l1_do_not_keepdims_example</tt>, <tt>test_reduce_l1_do_not_keepdims_random</tt>, <tt>test_reduce_l1_empty_set</tt>, <tt>test_reduce_l1_keep_dims_example</tt>, <tt>test_reduce_l1_keep_dims_random</tt>, <tt>test_reduce_l1_negative_axes_keep_dims_example</tt>, <tt>test_reduce_l1_negative_axes_keep_dims_random</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_87973fac-5e96-6c7d-b12f-045b4a090e9c"><p id="_5f7c8a4a-7877-74b3-87a8-60f5c46cc594">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_ea22e95a-6b33-954e-ed69-b501268243b5" anchor="op-ai-onnx-default-reducel2" obligation="normative">
<title id="_2aa69d6b-bdc9-2521-e7f7-bfcd1ef725c6">ReduceL2</title>
<p id="_c2644f3f-224e-9651-4494-9331a953099e">Computes the L2 norm of the input tensor’s elements along the provided axes. The resulting tensor has the same rank as the input if  <tt>keepdims</tt> equals 1. If <tt>keepdims</tt> equals 0, then the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are valid. Reduction over an empty set of values yields 0.</p>

<p id="_da7a3aac-119b-eea4-9441-429c5ec648eb">The above behavior is similar to numpy, with the exception that numpy defaults <tt>keepdims</tt> to  <tt>False</tt> instead of <tt>True</tt>.</p>

<dl id="_3b645ca5-e0ea-d7d2-e6be-5a733b194012"><dt>Domain</dt>
<dd id="_7b126d44-7d99-60a4-7c11-1693c130d4a6"><p id="_2da61543-b75a-4184-8f6a-d76e721eaff1"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_fc784cb8-301a-370e-c32c-b23509767060"><p id="_74b1ba79-1eb0-14bb-16a6-e30b9c9a107e">18</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_223c7b1f-a7b8-eaa9-7120-becb20fb0f2a"><p id="_7fb1a724-9c57-d778-f7f4-52f07b01b475">1, 11, 13</p>
</dd>
<dt>Inputs (1 — 2)</dt>
<dd id="_bf7772b7-381a-c5ef-c5e9-bd9be054d9bc"><p id="_76472e53-aafd-b187-1259-322200908869"><tt>data (differentiable) : T</tt> — An input tensor.<br/> <tt>axes (optional, non-differentiable) : tensor(int64)</tt> — Optional input list of integers, along which to reduce. The default is to reduce over empty axes. When axes is empty (either not provided or explicitly empty), behavior depends on ‘noop_with_empty_axes’: reduction over all axes if ‘noop_with_empty_axes’ is false, and reduction over the empty set of axes when ‘noop_with_empty_axes’ is true. Accepted range is [-r, r-1] where r = rank(data).</p>
</dd>
<dt>Outputs</dt>
<dd id="_c98eec17-414c-a378-349c-ae036761f1ce"><p id="_19282396-ad01-3046-7d88-10376da2cf63"><tt>reduced (differentiable) : T</tt> — Reduced output tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_0358dc1a-941e-34b0-319a-8d0ebd638067"><p id="_997c75ab-fc51-f98a-9dff-16fe1581e760"><tt>keepdims : int (default is 1)</tt> — Keep the reduced dimension or not, default 1 means keep reduced dimension.<br/> <tt>noop_with_empty_axes : int (default is 0)</tt> — Defines behavior when axes is not provided or is empty. If false (default), reduction happens over all axes (similar to the case when <tt>axis=None</tt> in numpy). If true, reduction happens over an empty set of axes (similar to the case when <tt>axis=()</tt> in numpy). Note that reduction over an empty set of axes means that the reduction step behaves like a no-op (identity function), but composite-reduction operators will still perform the non-reduction steps as needed. Thus, ReduceLogSum returns the Log of input tensor, and ReduceSumSquare returns the Square of the input tensor, in this case.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_8636583e-507b-32e0-fad7-40ed9affefb0"><p id="_dc343cee-7699-279b-4d75-680863c331f1"><tt>T : tensor(uint32), tensor(uint64), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_a1ad22c3-3b52-004a-c689-8e44e7fb31ea"><p id="_e2abd178-4c07-864f-5231-911eec78cd8e"><tt>test_reduce_l2_default_axes_keepdims_example</tt>, <tt>test_reduce_l2_default_axes_keepdims_random</tt>, <tt>test_reduce_l2_do_not_keepdims_example</tt>, <tt>test_reduce_l2_do_not_keepdims_random</tt>, <tt>test_reduce_l2_empty_set</tt>, <tt>test_reduce_l2_keep_dims_example</tt>, <tt>test_reduce_l2_keep_dims_random</tt>, <tt>test_reduce_l2_negative_axes_keep_dims_example</tt>, <tt>test_reduce_l2_negative_axes_keep_dims_random</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_a38d64f9-6b69-1dc1-b000-8d55e28065c5"><p id="_577a49d8-948c-8a34-a6f9-8ac86f593400">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_7f15a4f9-b92e-649b-638f-41fdb820097a" anchor="op-ai-onnx-default-reducelogsum" obligation="normative">
<title id="_f21963d5-20ea-b52f-eee1-b072fcc060e5">ReduceLogSum</title>
<p id="_462c2607-ff81-ddab-6e9e-a8b6c97c15cb">Computes the log sum of the input tensor’s elements along the provided axes. The resulting tensor has the same rank as the input if  <tt>keepdims</tt> equals 1. If <tt>keepdims</tt> equals 0, then the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are valid. Reduction over an empty set of values yields minus infinity (if supported by the datatype) or undefined otherwise.</p>

<p id="_671d394c-4982-ba00-a9e2-c7811a53dfaa">The above behavior is similar to numpy, with the exception that numpy defaults <tt>keepdims</tt> to  <tt>False</tt> instead of <tt>True</tt>.</p>

<dl id="_3c6f5e09-9850-cbee-c310-cbaedb47c33e"><dt>Domain</dt>
<dd id="_4faca819-badc-4786-d1a5-70ccd2039542"><p id="_005ffd07-4ff6-77f9-c8c9-d413a3612bb0"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_6fb1f99e-ab0e-88a5-347d-86d12fb7f291"><p id="_e6e442be-430d-f41b-3716-16ee036e7196">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_1958fa38-ff6d-95ee-d95b-61846b5fa90a"><p id="_3b7fa9ab-e841-31e6-c8c1-0d8e8467c73b">1, 11, 13, 18</p>
</dd>
<dt>Inputs (1 — 2)</dt>
<dd id="_419eec67-8462-8579-472b-3bba4c2b79d8"><p id="_49672ddf-b6d8-f7f4-6208-cf2d944e372b"><tt>data (differentiable) : T</tt> — An input tensor.<br/> <tt>axes (optional, non-differentiable) : tensor(int64)</tt> — Optional input list of integers, along which to reduce. The default is to reduce over empty axes. When axes is empty (either not provided or explicitly empty), behavior depends on ‘noop_with_empty_axes’: reduction over all axes if ‘noop_with_empty_axes’ is false, and reduction over the empty set of axes when ‘noop_with_empty_axes’ is true. Accepted range is [-r, r-1] where r = rank(data).</p>
</dd>
<dt>Outputs</dt>
<dd id="_d2a0906d-dded-215d-1b73-7a004c9182c8"><p id="_721c48f8-407f-abf7-53af-5533580f225f"><tt>reduced (differentiable) : T</tt> — Reduced output tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_b3d808f6-517c-a308-f276-928108c07365"><p id="_c9cf37d9-986d-4f2b-cef4-9bfa874a4d15"><tt>keepdims : int (default is 1)</tt> — Keep the reduced dimension or not, default 1 means keep reduced dimension.<br/> <tt>noop_with_empty_axes : int (default is 0)</tt> — Defines behavior when axes is not provided or is empty. If false (default), reduction happens over all axes (similar to the case when <tt>axis=None</tt> in numpy). If true, reduction happens over an empty set of axes (similar to the case when <tt>axis=()</tt> in numpy). Note that reduction over an empty set of axes means that the reduction step behaves like a no-op (identity function), but composite-reduction operators will still perform the non-reduction steps as needed. Thus, ReduceLogSum returns the Log of input tensor, and ReduceSumSquare returns the Square of the input tensor, in this case.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_ec16d999-4144-b2c8-3491-306d9fb6837b"><p id="_ef82f2d5-fd26-f848-b5e1-e41f5f4df6be"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_a346c7d3-f542-693e-2e8e-c9aa7ec9986b"><p id="_52beca00-1098-e642-e573-b8246cf82299"><tt>test_reduce_log_sum_empty_set</tt>, <tt>test_reduce_log_sum_default</tt>, <tt>test_reduce_log_sum_negative_axes</tt>, <tt>test_reduce_log_sum_desc_axes</tt>, <tt>test_reduce_log_sum_asc_axes</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_47cef20b-002b-aadf-ec18-0dc7120069e1"><p id="_751ab32c-dd7c-3a4c-8180-5b1bb3356e72">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_112322ad-626e-7995-c033-ae77378e6cce" anchor="op-ai-onnx-default-reducelogsumexp" obligation="normative">
<title id="_d6473590-5d3a-26d9-e6f7-e1dc50a23506">ReduceLogSumExp</title>
<p id="_e8374cca-d7ed-ce34-6514-1e933a041b92">Computes the log sum exponent of the input tensor’s elements along the provided axes. The resulting tensor has the same rank as the input if  <tt>keepdims</tt> equals 1. If <tt>keepdims</tt> equals 0, then the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are valid. Reduction over an empty set of values yields minus infinity (if supported by the datatype) or undefined otherwise.</p>

<p id="_0ec325bb-a677-b2ed-2575-dbd8ff35f873">The above behavior is similar to numpy, with the exception that numpy defaults <tt>keepdims</tt> to  <tt>False</tt> instead of <tt>True</tt>.</p>

<dl id="_4403d41f-99e8-4ac4-d626-7bb097e1f1c9"><dt>Domain</dt>
<dd id="_3b55ef83-fc38-36f9-cef1-2fbfdc40c04c"><p id="_7d787a22-df67-83e3-00b4-0a0cc43c9718"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_e351b00f-1283-ae9d-d6fd-725e4ccebc4d"><p id="_c8f843b3-086b-71cc-ed6e-50d6d5979874">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_78f7d5fd-9939-4d58-c7fa-ac5e9455bd86"><p id="_6258e088-51f0-69fd-60eb-a8b7b6fc01ed">1, 11, 13, 18</p>
</dd>
<dt>Inputs (1 — 2)</dt>
<dd id="_9cb51973-5c20-e7f1-cff1-cad3d1fd4ffe"><p id="_bb1058d6-79de-63bc-3a5a-02b4dd478e44"><tt>data (differentiable) : T</tt> — An input tensor.<br/> <tt>axes (optional, non-differentiable) : tensor(int64)</tt> — Optional input list of integers, along which to reduce. The default is to reduce over empty axes. When axes is empty (either not provided or explicitly empty), behavior depends on ‘noop_with_empty_axes’: reduction over all axes if ‘noop_with_empty_axes’ is false, and reduction over the empty set of axes when ‘noop_with_empty_axes’ is true. Accepted range is [-r, r-1] where r = rank(data).</p>
</dd>
<dt>Outputs</dt>
<dd id="_2a031de6-6d5b-d742-bab3-a20ac19a4c4c"><p id="_051db3ad-0128-876b-8631-15cb51c94628"><tt>reduced (differentiable) : T</tt> — Reduced output tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_b4d75836-eab1-eda7-2491-95505f5050f4"><p id="_af75b906-805a-bb62-da58-4aa2a8b90cad"><tt>keepdims : int (default is 1)</tt> — Keep the reduced dimension or not, default 1 means keep reduced dimension.<br/> <tt>noop_with_empty_axes : int (default is 0)</tt> — Defines behavior when axes is not provided or is empty. If false (default), reduction happens over all axes (similar to the case when <tt>axis=None</tt> in numpy). If true, reduction happens over an empty set of axes (similar to the case when <tt>axis=()</tt> in numpy). Note that reduction over an empty set of axes means that the reduction step behaves like a no-op (identity function), but composite-reduction operators will still perform the non-reduction steps as needed. Thus, ReduceLogSum returns the Log of input tensor, and ReduceSumSquare returns the Square of the input tensor, in this case.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_0fb954c2-6cc9-84da-cc39-ad89a383b763"><p id="_c4ab591f-6bcd-cafd-cd16-c0d61aad5c31"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_2193bc13-5050-4810-9c71-c73737a3f0ed"><p id="_8f7bff66-1057-2038-3caa-9d5b7892673b"><tt>test_reduce_log_sum_exp_default_axes_keepdims_example</tt>, <tt>test_reduce_log_sum_exp_default_axes_keepdims_random</tt>, <tt>test_reduce_log_sum_exp_do_not_keepdims_example</tt>, <tt>test_reduce_log_sum_exp_do_not_keepdims_random</tt>, <tt>test_reduce_log_sum_exp_empty_set</tt>, <tt>test_reduce_log_sum_exp_keepdims_example</tt>, <tt>test_reduce_log_sum_exp_keepdims_random</tt>, <tt>test_reduce_log_sum_exp_negative_axes_keepdims_example</tt>, <tt>test_reduce_log_sum_exp_negative_axes_keepdims_random</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_75767f97-f09b-b10d-3b3b-a9061450a49e"><p id="_251684d5-b5ed-e1c1-b69d-9f3d5d86ba51">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_7e57425e-a436-c908-3789-7e051331580d" anchor="op-ai-onnx-default-reducemax" obligation="normative">
<title id="_7af9af76-7002-096a-d3a0-b8e0e7038677">ReduceMax</title>
<p id="_be82b25e-b5f3-0bbb-7af3-354a32cf77e2">Computes the max of the input tensor’s elements along the provided axes. The resulting tensor has the same rank as the input if  <tt>keepdims</tt> equals 1. If <tt>keepdims</tt> equals 0, then the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are valid. Reduction over an empty set of values yields minus infinity (if supported by the datatype) or the minimum value of the data type otherwise.</p>

<p id="_a7c36137-4bac-61fa-3915-37526b12852d">If the input data type is Boolean, the comparison should consider <tt>False &lt; True</tt>.</p>

<p id="_812a081e-3507-2678-5454-2cf43f32f6a0">The above behavior is similar to numpy, with the exception that numpy defaults <tt>keepdims</tt> to  <tt>False</tt> instead of <tt>True</tt>.</p>

<dl id="_2b28a7fe-9ba8-d18b-3d68-fac56c96ba46"><dt>Domain</dt>
<dd id="_d554ca31-d00f-a6f0-60c9-7359ad47b813"><p id="_3ebc6ca6-1924-5c66-3617-024ba9b6b632"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_276dedc6-c988-18a4-1676-b96af5b549be"><p id="_44c073f9-46cf-6c42-2399-1d538df26f14">20</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_25c3764b-59c8-bce2-22ab-69d6ecd184ce"><p id="_158f4d81-c8b1-19d3-5d2d-1662142f1a25">1, 11, 12, 13, 18</p>
</dd>
<dt>Inputs (1 — 2)</dt>
<dd id="_043d509f-d3e9-8290-ecc5-a06d6262ca1c"><p id="_79d9f426-70a5-a1a2-75a0-0ef4e91156b5"><tt>data (differentiable) : T</tt> — An input tensor.<br/> <tt>axes (optional, non-differentiable) : tensor(int64)</tt> — Optional input list of integers, along which to reduce. The default is to reduce over empty axes. When axes is empty (either not provided or explicitly empty), behavior depends on ‘noop_with_empty_axes’: reduction over all axes if ‘noop_with_empty_axes’ is false, and reduction over the empty set of axes when ‘noop_with_empty_axes’ is true. Accepted range is [-r, r-1] where r = rank(data).</p>
</dd>
<dt>Outputs</dt>
<dd id="_b288c07e-bfc0-886d-451a-e86f8edc8f27"><p id="_0ed8282a-0196-86dd-21f4-710798f49051"><tt>reduced (differentiable) : T</tt> — Reduced output tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_d7d80cc2-6ea1-303e-de88-c04b4ab6f408"><p id="_fb9a81fd-707a-1d27-e11d-0f099f48d4dd"><tt>keepdims : int (default is 1)</tt> — Keep the reduced dimension or not, default 1 means keep reduced dimension.<br/> <tt>noop_with_empty_axes : int (default is 0)</tt> — Defines behavior when axes is not provided or is empty. If false (default), reduction happens over all axes (similar to the case when <tt>axis=None</tt> in numpy). If true, reduction happens over an empty set of axes (similar to the case when <tt>axis=()</tt> in numpy). Note that reduction over an empty set of axes means that the reduction step behaves like a no-op (identity function), but composite-reduction operators will still perform the non-reduction steps as needed. Thus, ReduceLogSum returns the Log of input tensor, and ReduceSumSquare returns the Square of the input tensor, in this case.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_a8440ce8-8cc6-ecf4-5cf6-c6b9adca5804"><p id="_ea9c69f7-ebd3-c1fa-918d-0fae4a0a93f4"><tt>T : tensor(uint32), tensor(uint64), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16), tensor(uint8), tensor(int8), tensor(bool)</tt> — Constrain input and output types to numeric and Boolean tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_1ec44685-38d9-5426-8cfa-dc496234ab4b"><p id="_5bcd77f6-1db0-dd48-bb51-207801e8595e"><tt>test_reduce_max_bool_inputs</tt>, <tt>test_reduce_max_default_axes_keepdim_example</tt>, <tt>test_reduce_max_default_axes_keepdims_random</tt>, <tt>test_reduce_max_do_not_keepdims_example</tt>, <tt>test_reduce_max_do_not_keepdims_random</tt>, <tt>test_reduce_max_empty_set</tt>, <tt>test_reduce_max_empty_set_bool</tt>, <tt>test_reduce_max_keepdims_example</tt>, <tt>test_reduce_max_keepdims_random</tt>, <tt>test_reduce_max_negative_axes_keepdims_example</tt>, <tt>test_reduce_max_negative_axes_keepdims_random</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_22746a1e-2f1f-c0d0-e375-3ff5578c076f"><p id="_21aa8682-47c9-878d-6f3d-06dfb5486b56">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_7d2ad677-7d46-be5f-7f37-53b3eaf19660" anchor="op-ai-onnx-default-reducemean" obligation="normative">
<title id="_a9be0b10-94d5-78d5-bc51-8fd3d3746355">ReduceMean</title>
<p id="_0388d3ec-2df2-bbdf-8250-d22535f0b9a3">Computes the mean of the input tensor’s elements along the provided axes. The resulting tensor has the same rank as the input if  <tt>keepdims</tt> equals 1. If <tt>keepdims</tt> equals 0, then the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are valid. Reduction over an empty set of values yields undefined.</p>

<p id="_69c3a4ce-ca14-ea66-e81a-037e02e05e6f">The above behavior is similar to numpy, with the exception that numpy defaults <tt>keepdims</tt> to  <tt>False</tt> instead of <tt>True</tt>.</p>

<dl id="_6f948fe9-c5ae-2e0a-0c87-f71f180c802d"><dt>Domain</dt>
<dd id="_a69dc442-4c7b-d880-e1b1-6a6fca6e1d7c"><p id="_0c3de53c-ed33-e414-e293-43f50ff3c5b3"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_ea6b3a1e-b264-a89a-0c84-2f93c6cd70e0"><p id="_3189b0e8-26a7-f0c0-42d5-78aa673a8815">18</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_4d9d19a6-4f4d-f46c-0f11-3d4b5d227fd2"><p id="_2883bb90-6270-3fd7-a5af-dcde077f91df">1, 11, 13</p>
</dd>
<dt>Inputs (1 — 2)</dt>
<dd id="_dd0dcb43-129e-b064-3077-4ddb5efbef69"><p id="_55a6fd4c-4f65-267f-9866-58fc43e402d0"><tt>data (differentiable) : T</tt> — An input tensor.<br/> <tt>axes (optional, non-differentiable) : tensor(int64)</tt> — Optional input list of integers, along which to reduce. The default is to reduce over empty axes. When axes is empty (either not provided or explicitly empty), behavior depends on ‘noop_with_empty_axes’: reduction over all axes if ‘noop_with_empty_axes’ is false, and reduction over the empty set of axes when ‘noop_with_empty_axes’ is true. Accepted range is [-r, r-1] where r = rank(data).</p>
</dd>
<dt>Outputs</dt>
<dd id="_36b04e6d-3203-60e5-3c4a-9e803f7342a3"><p id="_55e7d13c-1e7b-7961-1768-075f269d2765"><tt>reduced (differentiable) : T</tt> — Reduced output tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_df614174-a7cc-cc73-1dea-833baf13559c"><p id="_0f361587-fd83-506a-65f5-e1fcf5317c60"><tt>keepdims : int (default is 1)</tt> — Keep the reduced dimension or not, default 1 means keep reduced dimension.<br/> <tt>noop_with_empty_axes : int (default is 0)</tt> — Defines behavior when axes is not provided or is empty. If false (default), reduction happens over all axes (similar to the case when <tt>axis=None</tt> in numpy). If true, reduction happens over an empty set of axes (similar to the case when <tt>axis=()</tt> in numpy). Note that reduction over an empty set of axes means that the reduction step behaves like a no-op (identity function), but composite-reduction operators will still perform the non-reduction steps as needed. Thus, ReduceLogSum returns the Log of input tensor, and ReduceSumSquare returns the Square of the input tensor, in this case.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_dcb1f522-594a-c2c1-02c8-72414e1c49f6"><p id="_a4b2d4f7-73ab-7e46-3d10-423b571c7b72"><tt>T : tensor(uint32), tensor(uint64), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_401a4950-15e1-179a-c865-568fff6c3107"><p id="_ac997c18-28a2-242f-43a0-bd4b760a794c"><tt>test_reduce_mean_default_axes_keepdims_example</tt>, <tt>test_reduce_mean_default_axes_keepdims_random</tt>, <tt>test_reduce_mean_do_not_keepdims_example</tt>, <tt>test_reduce_mean_do_not_keepdims_random</tt>, <tt>test_reduce_mean_keepdims_example</tt>, <tt>test_reduce_mean_keepdims_random</tt>, <tt>test_reduce_mean_negative_axes_keepdims_example</tt>, <tt>test_reduce_mean_negative_axes_keepdims_random</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_c85fbdd8-7802-7cc9-39d7-aa4e2d77000d"><p id="_e60a697a-761d-a7dd-2d6f-d7d58c98b3b8">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_7f940d6d-4fe9-6cfe-dab2-b6da5848d74c" anchor="op-ai-onnx-default-reducemin" obligation="normative">
<title id="_65924c1b-b7d6-8425-b79e-97ab90f2b9e2">ReduceMin</title>
<p id="_29862728-963d-990e-4b44-97a4a3b0b8ac">Computes the min of the input tensor’s elements along the provided axes. The resulting tensor has the same rank as the input if  <tt>keepdims</tt> equals 1. If <tt>keepdims</tt> equals 0, then the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are valid. Reduction over an empty set of values yields plus infinity (if supported by the datatype) or the maximum value of the data type otherwise.</p>

<p id="_418f0bd0-f4f9-fd2f-f10f-089d3317831f">If the input data type is Boolean, the comparison should consider <tt>False &lt; True</tt>.</p>

<p id="_8105cbd6-896a-e46e-25dc-84950c2a4edd">The above behavior is similar to numpy, with the exception that numpy defaults <tt>keepdims</tt> to  <tt>False</tt> instead of <tt>True</tt>.</p>

<dl id="_deeb18e5-ad0e-a4dc-69ee-48ccfba325f1"><dt>Domain</dt>
<dd id="_11259f3a-73af-963a-a426-056ec85001a3"><p id="_93d57d67-ce63-459f-6183-643086509aa2"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_ae105396-c226-207f-b710-ca54f284da98"><p id="_a331665f-25d1-d8a1-1e21-a84ea7bcca87">20</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_8608e330-6a61-a2cb-1215-3d4b2aee11a5"><p id="_02e027a0-a709-a200-7cbb-c281f81b4730">1, 11, 12, 13, 18</p>
</dd>
<dt>Inputs (1 — 2)</dt>
<dd id="_64dbca03-e67d-90fc-9ea7-463a96a07fcd"><p id="_e9279d00-4f7b-e697-699d-8cd5f3575a4b"><tt>data (differentiable) : T</tt> — An input tensor.<br/> <tt>axes (optional, non-differentiable) : tensor(int64)</tt> — Optional input list of integers, along which to reduce. The default is to reduce over empty axes. When axes is empty (either not provided or explicitly empty), behavior depends on ‘noop_with_empty_axes’: reduction over all axes if ‘noop_with_empty_axes’ is false, and reduction over the empty set of axes when ‘noop_with_empty_axes’ is true. Accepted range is [-r, r-1] where r = rank(data).</p>
</dd>
<dt>Outputs</dt>
<dd id="_2ca9f0e0-6b2f-44df-704f-50cef4286039"><p id="_07e578c0-ef6b-ac0b-e22e-12a0c08f7ee8"><tt>reduced (differentiable) : T</tt> — Reduced output tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_32884de3-18de-f06e-92bd-9dcc3ea14536"><p id="_6ce933dc-5f4f-b3dc-6a10-b991c9a5408b"><tt>keepdims : int (default is 1)</tt> — Keep the reduced dimension or not, default 1 means keep reduced dimension.<br/> <tt>noop_with_empty_axes : int (default is 0)</tt> — Defines behavior when axes is not provided or is empty. If false (default), reduction happens over all axes (similar to the case when <tt>axis=None</tt> in numpy). If true, reduction happens over an empty set of axes (similar to the case when <tt>axis=()</tt> in numpy). Note that reduction over an empty set of axes means that the reduction step behaves like a no-op (identity function), but composite-reduction operators will still perform the non-reduction steps as needed. Thus, ReduceLogSum returns the Log of input tensor, and ReduceSumSquare returns the Square of the input tensor, in this case.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_ae6153f8-682f-96bc-0a81-d64bb6fa0d58"><p id="_9ab5cba7-e4a2-9cf5-1f4a-5014bfb3d5e4"><tt>T : tensor(uint32), tensor(uint64), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16), tensor(uint8), tensor(int8), tensor(bool)</tt> — Constrain input and output types to numeric and Boolean tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_c51a15a0-c738-7977-864f-aebf0dac2b9b"><p id="_ff254b1b-a1d9-01ad-1283-8c8cf6c65ae4"><tt>test_reduce_min_bool_inputs</tt>, <tt>test_reduce_min_default_axes_keepdims_example</tt>, <tt>test_reduce_min_default_axes_keepdims_random</tt>, <tt>test_reduce_min_do_not_keepdims_example</tt>, <tt>test_reduce_min_do_not_keepdims_random</tt>, <tt>test_reduce_min_empty_set</tt>, <tt>test_reduce_min_keepdims_example</tt>, <tt>test_reduce_min_keepdims_random</tt>, <tt>test_reduce_min_negative_axes_keepdims_example</tt>, <tt>test_reduce_min_negative_axes_keepdims_random</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_96d11039-1828-7fd9-b8e6-c9912af057f7"><p id="_66c3da40-a677-db88-8ba8-62b9ec64e051">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_084118cb-ec5c-0fad-fb8b-8a0eec2af87e" anchor="op-ai-onnx-default-reduceprod" obligation="normative">
<title id="_3f60f073-f326-6d4a-d25d-4ae35de7da3e">ReduceProd</title>
<p id="_5e51861f-81a7-a5db-4c11-fe3e13353c82">Computes the product of the input tensor’s elements along the provided axes. The resulting tensor has the same rank as the input if  <tt>keepdims</tt> equals 1. If <tt>keepdims</tt> equals 0, then the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are valid. Reduction over an empty set of values yields 1.</p>

<p id="_c93a7a7e-1b75-d37d-0b16-10984f331b05">The above behavior is similar to numpy, with the exception that numpy defaults <tt>keepdims</tt> to  <tt>False</tt> instead of <tt>True</tt>.</p>

<dl id="_7180fca6-7c63-df78-8ef3-9c6f46fa55de"><dt>Domain</dt>
<dd id="_7e1a9375-c929-ae9a-ce9d-d341b65195ca"><p id="_ce813665-0bbf-73ae-1bcf-16b2a3d9e506"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_f0c6f733-e12c-4d5d-2982-7a1c4ec909d7"><p id="_186669b9-71b8-9a42-77ed-6b85caf9fb9f">18</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_944b1220-3d6c-4af2-3f99-28458604ed0d"><p id="_9fdbaedc-5429-0999-69b9-be5b0cd4bbf9">1, 11, 13</p>
</dd>
<dt>Inputs (1 — 2)</dt>
<dd id="_01936466-d28e-f27d-462d-8319fd119c39"><p id="_ba16cede-fdbf-301e-efa5-c5a168017e90"><tt>data (differentiable) : T</tt> — An input tensor.<br/> <tt>axes (optional, non-differentiable) : tensor(int64)</tt> — Optional input list of integers, along which to reduce. The default is to reduce over empty axes. When axes is empty (either not provided or explicitly empty), behavior depends on ‘noop_with_empty_axes’: reduction over all axes if ‘noop_with_empty_axes’ is false, and reduction over the empty set of axes when ‘noop_with_empty_axes’ is true. Accepted range is [-r, r-1] where r = rank(data).</p>
</dd>
<dt>Outputs</dt>
<dd id="_c38e7e96-8fcf-22e3-c179-ade43644e8a5"><p id="_cb529f44-3032-2e12-b3ce-f103890b42c9"><tt>reduced (differentiable) : T</tt> — Reduced output tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_c46de330-b5cc-680c-84f1-caaa863654a1"><p id="_d2df3f3e-836a-4458-68c1-ff73cebedbc9"><tt>keepdims : int (default is 1)</tt> — Keep the reduced dimension or not, default 1 means keep reduced dimension.<br/> <tt>noop_with_empty_axes : int (default is 0)</tt> — Defines behavior when axes is not provided or is empty. If false (default), reduction happens over all axes (similar to the case when <tt>axis=None</tt> in numpy). If true, reduction happens over an empty set of axes (similar to the case when <tt>axis=()</tt> in numpy). Note that reduction over an empty set of axes means that the reduction step behaves like a no-op (identity function), but composite-reduction operators will still perform the non-reduction steps as needed. Thus, ReduceLogSum returns the Log of input tensor, and ReduceSumSquare returns the Square of the input tensor, in this case.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_cb92e17c-234d-0a42-af63-696488a8d5a6"><p id="_20292d0b-f9f7-24d5-52b5-93d98eeb8a9b"><tt>T : tensor(uint32), tensor(uint64), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_ce65ee94-ee0f-b238-fc41-0271b0769b20"><p id="_519e342e-3efb-432f-0a08-b82f5f123a0b"><tt>test_reduce_prod_default_axes_keepdims_example</tt>, <tt>test_reduce_prod_default_axes_keepdims_random</tt>, <tt>test_reduce_prod_do_not_keepdims_example</tt>, <tt>test_reduce_prod_do_not_keepdims_random</tt>, <tt>test_reduce_prod_empty_set</tt>, <tt>test_reduce_prod_keepdims_example</tt>, <tt>test_reduce_prod_keepdims_random</tt>, <tt>test_reduce_prod_negative_axes_keepdims_example</tt>, <tt>test_reduce_prod_negative_axes_keepdims_random</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_ddab1840-faa9-0dbc-6a9c-6d4f0e1e4a1f"><p id="_56be7ec1-05dd-0168-cc27-2b0db5970dd6">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_7b3e137e-0983-9ca3-7103-be1b277c1672" anchor="op-ai-onnx-default-reducesum" obligation="normative">
<title id="_f5afe04a-4b77-68ef-86ad-31faa156b049">ReduceSum</title>
<p id="_d79ce3bc-1b7a-fbaa-d606-a3527bcb9106">Computes the sum of the input tensor’s elements along the provided axes. The resulting tensor has the same rank as the input if  <tt>keepdims</tt> equals 1. If <tt>keepdims</tt> equals 0, then the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are valid. Reduction over an empty set of values yields 0.</p>

<p id="_a03dec32-6253-8494-691a-cafc9a3b5952">The above behavior is similar to numpy, with the exception that numpy defaults <tt>keepdims</tt> to  <tt>False</tt> instead of <tt>True</tt>.</p>

<dl id="_86191f25-6418-b43b-1879-e4dc8f195ee9"><dt>Domain</dt>
<dd id="_74e5b15e-675c-3e28-b546-cb25e4a179ee"><p id="_4289398c-c3c5-551e-f30e-8d33ba83c0b0"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_c97c94cf-fba7-69b1-0629-f4e186cdd5f3"><p id="_a0d04714-fdc1-aeeb-236f-797f23d612e1">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_c446a022-9a20-a048-1de2-8143f28cbce9"><p id="_f62ddbd6-f57c-861c-2d13-9cc68f19b7c3">1, 11</p>
</dd>
<dt>Inputs (1 — 2)</dt>
<dd id="_3d47db9c-2f91-590b-3d6b-812df78bcff8"><p id="_690a3378-0905-d747-1ef9-3a3fc4ab9c6b"><tt>data (differentiable) : T</tt> — An input tensor.<br/> <tt>axes (optional, non-differentiable) : tensor(int64)</tt> — Optional input list of integers, along which to reduce. The default is to reduce over empty axes. When axes is empty (either not provided or explicitly empty), behavior depends on ‘noop_with_empty_axes’: reduction over all axes if ‘noop_with_empty_axes’ is false, and reduction over the empty set of axes when ‘noop_with_empty_axes’ is true. Accepted range is [-r, r-1] where r = rank(data).</p>
</dd>
<dt>Outputs</dt>
<dd id="_64ba35df-0a90-f3eb-331e-565c40321771"><p id="_60fdf36d-1823-4dc3-bfe6-04258c713426"><tt>reduced (differentiable) : T</tt> — Reduced output tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_2f6e1a44-eb66-10f5-4283-4c5669b74a95"><p id="_ab27e698-e9b7-38dc-361d-9fda4c6398e7"><tt>keepdims : int (default is 1)</tt> — Keep the reduced dimension or not, default 1 means keep reduced dimension.<br/> <tt>noop_with_empty_axes : int (default is 0)</tt> — Defines behavior when axes is not provided or is empty. If false (default), reduction happens over all axes (similar to the case when <tt>axis=None</tt> in numpy). If true, reduction happens over an empty set of axes (similar to the case when <tt>axis=()</tt> in numpy). Note that reduction over an empty set of axes means that the reduction step behaves like a no-op (identity function), but composite-reduction operators will still perform the non-reduction steps as needed. Thus, ReduceLogSum returns the Log of input tensor, and ReduceSumSquare returns the Square of the input tensor, in this case.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_455d5bb8-be66-1057-e207-d070aa11a762"><p id="_95d5c991-f635-5f91-0746-bbaff03f881a"><tt>T : tensor(uint32), tensor(uint64), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_71973af4-9d01-516c-cbd5-aa85a2d2c64c"><p id="_52db7ec9-99a9-702f-1613-838eb03ed7ce"><tt>test_reduce_sum_default_axes_keepdims_example</tt>, <tt>test_reduce_sum_default_axes_keepdims_random</tt>, <tt>test_reduce_sum_do_not_keepdims_example</tt>, <tt>test_reduce_sum_do_not_keepdims_random</tt>, <tt>test_reduce_sum_empty_axes_input_noop_example</tt>, <tt>test_reduce_sum_empty_axes_input_noop</tt>, <tt>test_reduce_sum_empty_set</tt>, <tt>test_reduce_sum_keepdims_example</tt>, <tt>test_reduce_sum_keepdims_random</tt>, <tt>test_reduce_sum_negative_axes_keepdims_example</tt>, <tt>test_reduce_sum_negative_axes_keepdims_random</tt>, <tt>test_reduce_sum_empty_set_non_reduced_axis_zero</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_a38e2f9f-86dc-251e-717f-595acb0bba4d"><p id="_653c31af-85da-3090-e315-9cb14f252354">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_af5dd0f0-d63b-4cf1-7d3d-6047e846b4f9" anchor="op-ai-onnx-default-reducesumsquare" obligation="normative">
<title id="_686160e6-4556-8152-475e-c43670eafcf1">ReduceSumSquare</title>
<p id="_6f5f2d82-c6f7-f302-9c22-c8d0839417b8">Computes the sum square of the input tensor’s elements along the provided axes. The resulting tensor has the same rank as the input if  <tt>keepdims</tt> equals 1. If <tt>keepdims</tt> equals 0, then the resulting tensor has the reduced dimension pruned. Input tensors of rank zero are valid. Reduction over an empty set of values yields 0.</p>

<p id="_f266ea43-aea2-57b9-5fa1-5cc317fa1822">The above behavior is similar to numpy, with the exception that numpy defaults <tt>keepdims</tt> to  <tt>False</tt> instead of <tt>True</tt>.</p>

<dl id="_5536e7e8-4988-97f1-a66a-e119a7d5861d"><dt>Domain</dt>
<dd id="_fd9446d5-72e2-0612-dfaa-de8d5cce4afa"><p id="_4b82de73-239e-8849-7d02-e9717f5f61e2"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_574d4bdc-4fde-638a-14ec-1fad696ddd6f"><p id="_814f00ef-0961-7e18-7aa4-74918459d477">18</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_77ec7afc-f159-41ac-4b73-d00564ffbbd4"><p id="_092a1292-ec03-3c03-6ed8-1443de0667bd">1, 11, 13</p>
</dd>
<dt>Inputs (1 — 2)</dt>
<dd id="_421b81ba-2021-c939-81f1-5bedd390698a"><p id="_d8fa7da3-4c69-67b1-68d9-ad0f2c67d6a2"><tt>data (differentiable) : T</tt> — An input tensor.<br/> <tt>axes (optional, non-differentiable) : tensor(int64)</tt> — Optional input list of integers, along which to reduce. The default is to reduce over empty axes. When axes is empty (either not provided or explicitly empty), behavior depends on ‘noop_with_empty_axes’: reduction over all axes if ‘noop_with_empty_axes’ is false, and reduction over the empty set of axes when ‘noop_with_empty_axes’ is true. Accepted range is [-r, r-1] where r = rank(data).</p>
</dd>
<dt>Outputs</dt>
<dd id="_2674ceb3-728b-e2ae-544b-83761902282b"><p id="_6ba52afb-3d67-6481-0417-1289136e079f"><tt>reduced (differentiable) : T</tt> — Reduced output tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_b7b2046f-3d73-34d5-1361-554dcc9ec4e8"><p id="_8758b12a-2a43-0218-06be-d993c05bc475"><tt>keepdims : int (default is 1)</tt> — Keep the reduced dimension or not, default 1 means keep reduced dimension.<br/> <tt>noop_with_empty_axes : int (default is 0)</tt> — Defines behavior when axes is not provided or is empty. If false (default), reduction happens over all axes (similar to the case when <tt>axis=None</tt> in numpy). If true, reduction happens over an empty set of axes (similar to the case when <tt>axis=()</tt> in numpy). Note that reduction over an empty set of axes means that the reduction step behaves like a no-op (identity function), but composite-reduction operators will still perform the non-reduction steps as needed. Thus, ReduceLogSum returns the Log of input tensor, and ReduceSumSquare returns the Square of the input tensor, in this case.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_42583a6a-22b3-af29-5be1-1993bca2e7db"><p id="_2f8be723-2e0e-bebc-710f-47b205ab27e9"><tt>T : tensor(uint32), tensor(uint64), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_f0281b96-53c6-f48d-9154-35bbcd30dd5e"><p id="_7d019991-bde2-493d-2e77-c4a3140f3da6"><tt>test_reduce_sum_square_default_axes_keepdims_example</tt>, <tt>test_reduce_sum_square_default_axes_keepdims_random</tt>, <tt>test_reduce_sum_square_do_not_keepdims_example</tt>, <tt>test_reduce_sum_square_do_not_keepdims_random</tt>, <tt>test_reduce_sum_square_empty_set</tt>, <tt>test_reduce_sum_square_keepdims_example</tt>, <tt>test_reduce_sum_square_keepdims_random</tt>, <tt>test_reduce_sum_square_negative_axes_keepdims_example</tt>, <tt>test_reduce_sum_square_negative_axes_keepdims_random</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_f983e68c-b70d-7555-ce91-8fbc93e540a6"><p id="_50430ac6-88de-0b26-34e6-fbb1b959e49a">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_c9c10606-b250-c415-0bc0-08a94a72d477" anchor="op-ai-onnx-default-regexfullmatch" obligation="normative">
<title id="_52ee0516-e779-48a3-cc07-84d94ed6718f">RegexFullMatch</title>
<p id="_5fb8d325-b36f-1d99-3e25-28ba480b97ef">RegexFullMatch performs a full regex match on each element of the input tensor. If an element fully matches the regex pattern specified as an attribute, the corresponding element in the output is True and it is False otherwise. <link target="https://github.com/google/re2/wiki/Syntax">RE2</link> regex syntax is used.</p>

<dl id="_30198701-2ff1-14b0-fa04-ed2b8ad225ed"><dt>Domain</dt>
<dd id="_0dade394-acf5-ce83-d77e-07f34ef7a17f"><p id="_e422bedc-826d-5401-badb-434e65109fc3"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_cf371bd3-bcbe-3dcc-2c99-bbca6363a735"><p id="_d7ece986-b8d4-1ff1-f172-dfbab25562ea">20</p>
</dd>
<dt>Inputs</dt>
<dd id="_efa9d4ef-6d21-7eb0-a6d5-cdebfc19e446"><p id="_a5ff8d6d-ef1c-e24c-5ee3-57e575f05e04"><tt>X (non-differentiable) : T1</tt> — Tensor with strings to match on.</p>
</dd>
<dt>Outputs</dt>
<dd id="_05ef523d-891c-c8b9-100f-8a36eb876461"><p id="_c45aa46a-36e3-99d7-9a3b-8bddb6e94d7e"><tt>Y (non-differentiable) : T2</tt> — Tensor of bools indicating if each input string fully matches the regex pattern specified.</p>
</dd>
<dt>Attributes</dt>
<dd id="_ade9b580-5dc2-e2ed-6884-6a21447c7ad1"><p id="_abaf44f4-91ba-de62-03f3-84705c326eaf"><tt>pattern : string</tt> — Regex pattern to match on. This must be valid RE2 syntax.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_afae0039-59aa-6e26-b53c-89f709da95af"><p id="_3e5840e8-06fa-b077-376a-cb6de14deb72"><tt>T1 : tensor(string)</tt> — Inputs must be UTF-8 strings<br/> <tt>T2 : tensor(bool)</tt> — Outputs are bools and are True where there is a full regex match and False otherwise.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_c88839de-2ed3-da66-bd1f-07ceb65f3150"><p id="_2919aca9-f667-f6a7-9255-f041cbe5a5e3"><tt>test_regex_full_match_basic</tt>, <tt>test_regex_full_match_email_domain</tt>, <tt>test_regex_full_match_empty</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_69d301f9-4a4f-f0c8-2508-33c0fba1201f"><p id="_73510359-0ced-ce16-1a54-a89b765f1ad8">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_745341f8-1563-b024-a085-e972e184ecec" anchor="op-ai-onnx-default-relu" obligation="normative">
<title id="_ea2c4804-c741-5edb-3b7b-037e31faa39d">Relu</title>
<p id="_f2d20736-191f-1179-112c-2a2fd732ea37">Relu takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the rectified linear function, y = max(0, x), is applied to the tensor elementwise.</p>

<dl id="_0193ee4b-067a-f154-d5dd-e62b9eeee05c"><dt>Domain</dt>
<dd id="_9c703107-3eea-deea-add4-49cd1a4d5fb4"><p id="_05fa2529-0b44-3c2b-9fd3-9d97e42735a1"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_c9740469-c67c-6e5a-35f1-6dd3008eeb29"><p id="_0e1c348c-08b1-e432-8881-d7cd4e74ee01">14</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_269ed0cc-a208-5a61-5490-ab352bdee02a"><p id="_b1e213f8-bdfa-8957-6a12-b32554558fd2">1, 6, 13</p>
</dd>
<dt>Inputs</dt>
<dd id="_3bdd1f50-3e1c-277e-ecaa-a2823fffb2fc"><p id="_997d0044-8b4d-42fc-ade4-4c2ab350dad1"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_a663777d-ff6f-66e7-b0e1-462472ad4b38"><p id="_7fc6a2ee-c4fe-2283-4250-f3d3d5c354a6"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_2a58ad87-f2ce-3307-033a-fd2462cb562d"><p id="_faacc638-b2f7-a565-a5c4-50f2295c0f99">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_466170bd-533d-ba4c-05eb-7ae470840f6a"><p id="_7df2f9f3-a8a8-0b15-108e-09171a58485b"><tt>T : tensor(float), tensor(int32), tensor(int8), tensor(int16), tensor(int64), tensor(float16), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to signed numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_664b7d6e-231a-6b34-5939-eca047e36d7a"><p id="_a8d46653-0566-0387-f2d7-9ccf4403c06f"><tt>test_relu</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_7425ce56-cdfd-5dd1-6910-6d32b34ba75e"><p id="_3f4f116b-1fe2-eaa3-fb44-1dfc53288105">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_e9b222d8-360a-b1b1-e09d-1b7b44789d50" anchor="op-ai-onnx-default-reshape" obligation="normative">
<title id="_e2ee4f1f-0e9f-6825-bdc8-d57307ad8d36">Reshape</title>
<p id="_713dd9b3-413a-3e6e-e780-6947d311a2eb">Reshape the input tensor similar to numpy.reshape. First input is the data tensor, second input is a shape tensor which specifies the output shape. It outputs the reshaped tensor. At most one dimension of the new shape can be -1. In this case, the value is inferred from the size of the tensor and the remaining dimensions. A dimension could also be 0, in which case the actual dimension value is unchanged (i.e. taken from the input tensor). If ‘allowzero’ is set, and the new shape includes 0, the dimension will be set explicitly to zero (i.e. not taken from input tensor). Shape (second input) could be an empty shape, which means converting to a scalar. The input tensor’s shape and the output tensor’s shape are required to have the same number of elements.</p>

<p id="_6dc9edb6-873b-939f-394e-84a8b13d691b">If the attribute ‘allowzero’ is set, it is invalid for the specified shape to contain both a zero value and -1, as the value of the dimension corresponding to -1 cannot be determined uniquely.</p>

<dl id="_ed9957e6-d21e-8af6-c475-71af5c111327"><dt>Domain</dt>
<dd id="_3f070948-6a49-654d-b3b0-3f9ae0c05b71"><p id="_43538634-56e3-5b36-5c99-fee379efe4dc"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_94729d51-9c21-04b1-8bec-91df120fa348"><p id="_59428ec0-4d6d-7306-fee2-b58c00ced3b3">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_16090a85-d876-84ab-49f7-2b3229961a8c"><p id="_bbdf3e7d-7e92-0cbf-b802-9fa78731dcfa">1, 5, 13, 14, 19, 21, 23, 24</p>
</dd>
<dt>Inputs</dt>
<dd id="_c151a1af-9052-8fd8-7bdd-e1db88c8fdc0"><p id="_f7ffa19f-df16-7d41-2867-28558c46585e"><tt>data (differentiable) : T</tt> — An input tensor.<br/> <tt>shape (non-differentiable) : tensor(int64)</tt> — Specified shape for output.</p>
</dd>
<dt>Outputs</dt>
<dd id="_beed06b6-ce2b-2e62-22cd-f26d4e715d4b"><p id="_f0604b67-926c-e33c-6173-7ae3ae3de3c4"><tt>reshaped (differentiable) : T</tt> — Reshaped data.</p>
</dd>
<dt>Attributes</dt>
<dd id="_60674c45-22f0-1cd9-da1c-6c55c4d406a3"><p id="_c21a8542-686e-8993-d1fb-906669309a4c"><tt>allowzero : int (default is 0)</tt> — (Optional) By default, when any value in the ‘shape’ input is equal to zero the corresponding dimension value is copied from the input tensor dynamically. allowzero=1 indicates that if any value in the ‘shape’ input is set to zero, the zero value is honored, similar to NumPy.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_037c5af0-f96e-931d-6b8f-7deb9fcfc626"><p id="_a43bd2b2-e815-bc3a-1f33-4a35b782eadc"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2)</tt> — Constrain input and output types to all tensor types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_cb6e8a2d-3013-7e45-e671-2a2d2d5ceb15"><p id="_31e28084-dbb9-93e5-464d-b0f18ec7a1b6"><tt>test_reshape_</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_57d759c1-7453-53c0-31c9-92cb197e5d68"><p id="_c9ba8b9a-686b-c778-ebe9-57689d6636b9">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_bf635496-f0ce-495f-266e-696a62e68349" anchor="op-ai-onnx-default-resize" obligation="normative">
<title id="_be3264b5-8013-03ae-529b-aedba9bf0fe4">Resize</title>
<p id="_e576603f-5f56-1b32-29e3-096982fb09bf">Resize the input tensor. In general, it calculates every value in the output tensor as a weighted average of neighborhood (a.k.a. sampling locations) in the input tensor. Each dimension value of the output tensor is:</p>

<sourcecode id="_78f54357-a781-8d71-03ea-f0318ac210e3" unnumbered="true"><body>output_dimension = floor(input_dimension * (roi_end - roi_start) * scale)</body></sourcecode>


<p id="_0f0a52c4-8f88-c042-b3d8-cdbe9763eb58">if input “sizes” is not specified.</p>

<dl id="_0545b802-45af-9a8e-335f-1d903b11ccfe"><dt>Domain</dt>
<dd id="_3cf28e5f-25d9-0495-ec51-7d300ccdbd66"><p id="_2f9c1dd2-0165-89f8-763a-0631fdac21fa"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_4712c476-6dfd-4d47-d930-a81020d7aefb"><p id="_114e1b74-c743-f8ac-5ccd-7484c4636df6">19</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_300156d3-b5f6-e1f8-cd73-bf362038a6b4"><p id="_4feea90e-eae6-349d-5127-55e4aad5cdf7">10, 11, 13, 18</p>
</dd>
<dt>Inputs (1 — 4)</dt>
<dd id="_810c7009-ea66-da68-9d3e-e27e9c0f63a3"><p id="_a367abd7-97d7-9ee8-dcce-adae3325b6c2"><tt>X (differentiable) : T1</tt> — N-D tensor<br/> <tt>roi (optional, non-differentiable) : T2</tt> — 1-D tensor given as [start1, …​, startN, end1, …​, endN], where N is the rank of X or the length of axes, if provided. The RoIs’ coordinates are normalized in the coordinate system of the input image. It only takes effect when coordinate_transformation_mode is “tf_crop_and_resize”<br/> <tt>scales (optional, non-differentiable) : tensor(float)</tt> — The scale array along each dimension. It takes value greater than 0. If it’s less than 1, it’s sampling down, otherwise, it’s upsampling. The number of elements of ‘scales’ should be the same as the rank of input ‘X’ or the length of ‘axes’, if provided. One of ‘scales’ and ‘sizes’ MUST be specified and it is an error if both are specified. If ‘sizes’ is needed, the user can use an empty string as the name of ‘scales’ in this operator’s input list.<br/> <tt>sizes (optional, non-differentiable) : tensor(int64)</tt> — Target size of the output tensor. Its interpretation depends on the ‘keep_aspect_ratio_policy’ value.The number of elements of ‘sizes’ should be the same as the rank of input ‘X’, or the length of ‘axes’, if provided. Only one of ‘scales’ and ‘sizes’ can be specified.</p>
</dd>
<dt>Outputs</dt>
<dd id="_ad5b5331-7059-4509-dd73-32cacfa5ac17"><p id="_8d1b94e3-ead0-571b-bb8f-cef9840477e2"><tt>Y (differentiable) : T1</tt> — N-D tensor after resizing</p>
</dd>
<dt>Attributes</dt>
<dd id="_e9b73aa0-10b2-538b-83cc-b64984cc7838"><p id="_5a526996-3343-2c10-7b03-f19c95ed9367"><tt>antialias : int (default is 0)</tt> — If set to 1, “linear” and “cubic” interpolation modes will use an antialiasing filter when downscaling. Antialiasing is achieved by stretching the resampling filter by a factor max(1, 1 / scale), which means that when downsampling, more input pixels contribute to an output pixel.<br/> <tt>axes : list of ints</tt> — If provided, it specifies a subset of axes that ‘roi’, ‘scales’ and ‘sizes’ refer to. If not provided, all axes are assumed [0, 1, …​, r-1], where r = rank(data). Non-specified dimensions are interpreted as non-resizable. Negative value means counting dimensions from the back. Accepted range is [-r, r-1], where r = rank(data). Behavior is undefined if an axis is repeated.<br/> <tt>coordinate_transformation_mode : string (default is half_pixel)</tt> — This attribute describes how to transform the coordinate in the resized tensor to the coordinate in the original tensor. The coordinate of each dimension is transformed individually. Let’s describe a case using axis x as an example. Denote <tt>x_resized</tt> as the coordinate of axis x in the resized tensor, <tt>x_original</tt> as the coordinate of axis x in the original tensor, <tt>length_original</tt> as the length of the original tensor in axis x, <tt>length_resized</tt> as the length of the resized tensor in axis x, <tt>scale = length_resized / length_original</tt>, <tt>output_width</tt> the target length on the axis x which can be a fractional number when it is calculated out of a scale factor, and <tt>output_width_int</tt> the effective output width as an integer. if coordinate_transformation_mode is <tt>"half_pixel"</tt>, <tt>x_original = (x_resized + 0.5) / scale - 0.5</tt> if coordinate_transformation_mode is <tt>"half_pixel_symmetric"</tt>, <tt>adjustment = output_width_int / output_width center = input_width / 2 offset = center * (1 - adjustment) x_ori = offset + (x + 0.5) / scale - 0.5</tt> if coordinate_transformation_mode is <tt>"pytorch_half_pixel"</tt>, <tt>x_original = length_resized &gt; 1 ? (x_resized + 0.5) / scale - 0.5 : 0</tt> if coordinate_transformation_mode is <tt>"align_corners"</tt>, <tt>x_original = x_resized * (length_original - 1) / (length_resized - 1)</tt> if coordinate_transformation_mode is <tt>"asymmetric"</tt>, <tt>x_original = x_resized / scale</tt> if coordinate_transformation_mode is <tt>"tf_crop_and_resize"</tt>, <tt>x_original = length_resized &gt; 1 ? start_x * (length_original - 1) + x_resized * (end_x - start_x) * (length_original - 1) / (length_resized - 1) : 0.5 * (start_x + end_x) * (length_original - 1)</tt> .<br/> <tt>cubic_coeff_a : float (default is -0.75)</tt> — The coefficient ‘a’ used in cubic interpolation. Two common choice are -0.5 (in some cases of TensorFlow) and -0.75 (in PyTorch). Check out Equation (4) in <link target="https://ieeexplore.ieee.org/document/1163711"/> for the details. This attribute is valid only if mode is “cubic”.<br/> <tt>exclude_outside : int (default is 0)</tt> — If set to 1, the weight of sampling locations outside the tensor will be set to 0 and the weight will be renormalized so that their sum is 1.0. The default value is 0.<br/> <tt>extrapolation_value : float (default is 0.0)</tt> — When coordinate_transformation_mode is “tf_crop_and_resize” and x_original is outside the range [0, length_original — 1], this value is used as the corresponding output value. Default is 0.0f.<br/> <tt>keep_aspect_ratio_policy : string (default is stretch)</tt> — This attribute describes how to interpret the <tt>sizes</tt> input with regard to keeping the original aspect ratio of the input, and it is not applicable when the <tt>scales</tt> input is used. Given a set of <tt>sizes</tt>, associated with a subset of <tt>axes</tt> (explicitly provided or default), and assuming <tt>d = axes[i]</tt>, with <tt>i</tt> being the index of the provided <tt>sizes</tt>. If <tt>keep_aspect_ratio_policy</tt> is <tt>"stretch"</tt>, the original aspect ratio is disregarded, and the input is resized to the specified size: <tt>out_size[d] = sizes[i]</tt> If <tt>keep_aspect_ratio_policy</tt> is <tt>"not_larger"</tt>, the sizes are adjusted so that no extent of the output is larger than the specified size, while keeping the original aspect ratio: <tt>scale = Min(sizes[i] / in_size[d]) out_size[d] = round_int(scale * in_size[d])</tt> If <tt>keep_aspect_ratio_policy</tt> is <tt>"not_smaller"</tt>, the sizes are adjusted so that no extent of the output is smaller than the specified size, while keeping the original aspect ratio: <tt>scale = Max(sizes[i] / in_size[d]) out_size[d] = round_int(scale * in_size[d])</tt> For non-resizable axes (those not specified in <tt>axes</tt>), the output size will be equal to the input size. Note: <tt>round_int</tt> stands for computing the nearest integer value, rounding halfway cases up.<br/> <tt>mode : string (default is nearest)</tt> — Three interpolation modes: “nearest” (default), “linear” and “cubic”. The “linear” mode includes linear interpolation for 1D tensor and N-linear interpolation for N-D tensor (for example, bilinear interpolation for 2D tensor). The “cubic” mode includes cubic interpolation for 1D tensor and N-cubic interpolation for N-D tensor (for example, bicubic interpolation for 2D tensor).<br/> <tt>nearest_mode : string (default is round_prefer_floor)</tt> — Four modes: “round_prefer_floor” (default, as known as round half down), “round_prefer_ceil” (as known as round half up), “floor”, “ceil”. Only used by nearest interpolation. It indicates how to get “nearest” pixel in input tensor from x_original, so this attribute is valid only if “mode” is “nearest”.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_4e8ef750-f997-032a-07c9-bd9b849d58fa"><p id="_93bd9c99-f935-4d0a-7ed3-ec797a4d4fc4"><tt>T1 : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input ‘X’ and output ‘Y’ to all tensor types.<br/> <tt>T2 : tensor(float16), tensor(float), tensor(double)</tt> — Constrain roi type to float or double.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_efe19cdb-3096-5acc-4b35-c9a64c96a6c8"><p id="_bd0aaecb-786e-75fc-6d14-d8ec4f3f048f"><tt>test_resize_downsample_scales_cubic</tt>, <tt>test_resize_downsample_scales_cubic_A_n0p5_exclude_outside</tt>, <tt>test_resize_downsample_scales_cubic_align_corners</tt>, <tt>test_resize_downsample_scales_cubic_antialias</tt>, <tt>test_resize_downsample_scales_linear</tt>, <tt>test_resize_downsample_scales_linear_align_corners</tt>, <tt>test_resize_downsample_scales_linear_antialias</tt>, <tt>test_resize_downsample_scales_linear_half_pixel_symmetric</tt>, <tt>test_resize_downsample_scales_nearest</tt>, <tt>test_resize_downsample_sizes_cubic</tt>, <tt>test_resize_downsample_sizes_cubic_antialias</tt>, <tt>test_resize_downsample_sizes_linear_antialias</tt>, <tt>test_resize_downsample_sizes_linear_pytorch_half_pixel</tt>, <tt>test_resize_downsample_sizes_nearest</tt>, <tt>test_resize_downsample_sizes_nearest_not_larger</tt>, <tt>test_resize_downsample_sizes_nearest_not_smaller</tt>, <tt>test_resize_tf_crop_and_resize</tt>, <tt>test_resize_tf_crop_and_resize_axes_2_3</tt>, <tt>test_resize_tf_crop_and_resize_axes_3_2</tt>, <tt>test_resize_tf_crop_and_resize_extrapolation_value</tt>, <tt>test_resize_upsample_scales_cubic</tt>, <tt>test_resize_upsample_scales_cubic_A_n0p5_exclude_outside</tt>, <tt>test_resize_upsample_scales_cubic_align_corners</tt>, <tt>test_resize_upsample_scales_cubic_asymmetric</tt>, <tt>test_resize_upsample_scales_linear</tt>, <tt>test_resize_upsample_scales_linear_align_corners</tt>, <tt>test_resize_upsample_scales_linear_half_pixel_symmetric</tt>, <tt>test_resize_upsample_scales_nearest</tt>, <tt>test_resize_upsample_scales_nearest_axes_2_3</tt>, <tt>test_resize_upsample_scales_nearest_axes_3_2</tt>, <tt>test_resize_upsample_sizes_cubic</tt>, <tt>test_resize_upsample_sizes_nearest</tt>, <tt>test_resize_upsample_sizes_nearest_axes_2_3</tt>, <tt>test_resize_upsample_sizes_nearest_axes_3_2</tt>, <tt>test_resize_upsample_sizes_nearest_ceil_half_pixel</tt>, <tt>test_resize_upsample_sizes_nearest_floor_align_corners</tt>, <tt>test_resize_upsample_sizes_nearest_not_larger</tt>, <tt>test_resize_upsample_sizes_nearest_not_smaller</tt>, <tt>test_resize_upsample_sizes_nearest_round_prefer_ceil_asymmetric</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_0dbfd389-c69f-76d5-0419-abe000da1bcb"><p id="_67221c92-ff89-81aa-294a-4cdb816404bc">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_84c44137-da9d-c135-1f15-04a8a30c9ae5" anchor="op-ai-onnx-default-reversesequence" obligation="normative">
<title id="_555d60c2-74a0-9287-f9e4-c68f14dfe942">ReverseSequence</title>
<p id="_c8893fe5-88e4-d109-2aa8-3798cf3637b5">Reverse batch of sequences having different lengths specified by <tt>sequence_lens</tt>.</p>

<p id="_be68c46a-dfa5-0266-4f3a-e9e3dbe7d45c">For each slice i iterating on batch axis, the operator reverses the first sequence_lens[i] elements on time axis, and copies elements whose index’s beyond sequence_lens[i] to the output. So the output slice i contains reversed sequences on the first sequence_lens[i] elements, then have original values copied for the other elements.</p>

<p id="_66ee0842-a7ae-e45f-46ea-02f1dbd6a46c">Example 1:   input = [[0.0, 4.0, 8.0,  12.0],            [1.0, 5.0, 9.0,  13.0],            [2.0, 6.0, 10.0, 14.0],            [3.0, 7.0, 11.0, 15.0]]   sequence_lens = [4, 3, 2, 1]   time_axis = 0   batch_axis = 1</p>

<p id="_8be0be3f-431d-a2ca-e91d-6203ff1decc4">output = [[3.0, 6.0, 9.0,  12.0],             [2.0, 5.0, 8.0,  13.0],             [1.0, 4.0, 10.0, 14.0],             [0.0, 7.0, 11.0, 15.0]]</p>

<p id="_037d9956-098c-1edb-53e2-918ca35c6e02">Example 2:   input = [[0.0,  1.0,  2.0,  3.0 ],            [4.0,  5.0,  6.0,  7.0 ],            [8.0,  9.0,  10.0, 11.0],            [12.0, 13.0, 14.0, 15.0]]   sequence_lens = [1, 2, 3, 4]   time_axis = 1   batch_axis = 0</p>

<p id="_dcba46c8-1fd8-2a0c-0fde-c0bc63a5a268">output = [[0.0,  1.0,  2.0,  3.0 ],             [5.0,  4.0,  6.0,  7.0 ],             [10.0, 9.0,  8.0,  11.0],             [15.0, 14.0, 13.0, 12.0]]</p>

<dl id="_ebc116c2-292e-68dc-c99e-f7ca24b7c326"><dt>Domain</dt>
<dd id="_888bfa4b-efa8-2b6c-2251-70a0d4e48eb2"><p id="_fc6a51a0-c9c2-0828-2e9a-02a8a24c5ffd"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_28e486aa-9d73-e60d-4eb3-6061c8290805"><p id="_9204284d-b7b7-842b-bf74-9f4522d26c21">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_069b8126-721f-07fe-a753-a21fb449c948"><p id="_7072780d-7ff9-6e56-4872-458346ec12d6">10</p>
</dd>
<dt>Inputs</dt>
<dd id="_21b70e8c-7879-a8d2-82ff-a3a35aa80b08"><p id="_486631c4-c3fb-c0ec-f20e-356727bb91e8"><tt>input : T</tt> — Tensor of rank r &gt;= 2.<br/> <tt>sequence_lens : tensor(int64)</tt> — Tensor specifying lengths of the sequences in a batch. It has shape <tt>[batch_size]</tt>.</p>
</dd>
<dt>Outputs</dt>
<dd id="_35ac5ab5-80cf-caec-c9bb-a348488cb6a6"><p id="_f6d1e65b-5223-d82e-7e8e-d6f5ef5a02cc"><tt>Y : T</tt> — Tensor with same shape of input.</p>
</dd>
<dt>Attributes</dt>
<dd id="_db630df2-7f15-a74c-a38c-69906a2d289b"><p id="_77f79a07-43fb-7f10-4957-74819f3d551a"><tt>batch_axis : int (default is 1)</tt> — (Optional) Specify which axis is batch axis. Must be one of 1 (default), or 0.<br/> <tt>time_axis : int (default is 0)</tt> — (Optional) Specify which axis is time axis. Must be one of 0 (default), or 1.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_ea031c6f-c94d-5d19-a620-c03800cc9d7f"><p id="_1eacb83f-8df5-afcd-5ad4-4cf694fd03c1"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Input and output types can be of any tensor type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_1e42985a-3909-d809-d495-c4f67dcd2f35"><p id="_507e533c-00e7-4e42-68aa-9e6e9a3dfff7"><tt>test_reversesequence_batch</tt>, <tt>test_reversesequence_bfloat16</tt>, <tt>test_reversesequence_time</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_fda48fcf-146a-3482-9be5-5da78d1f4000"><p id="_258d84d4-fd38-767d-8917-59e4d7ee274a">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_d574a8a1-2da4-02d4-2817-0140047df18b" anchor="op-ai-onnx-default-roialign" obligation="normative">
<title id="_e966e164-173c-3534-d92b-bc38636d9f5d">RoiAlign</title>
<p id="_db2889fe-c83f-8b8d-d47c-12c4beb9f425">Region of Interest (RoI) align operation described in the <link target="https://arxiv.org/abs/1703.06870">Mask R-CNN paper</link>. RoiAlign consumes an input tensor X and region of interests (rois) to apply pooling across each RoI; it produces a 4-D tensor of shape (num_rois, C, output_height, output_width).</p>

<p id="_24e7b097-9f39-9b10-70d9-4cbaf1b010a2">RoiAlign is proposed to avoid the misalignment by removing quantizations while converting from original image into feature map and from feature map into RoI feature; in each ROI bin, the value of the sampled locations are computed directly through bilinear interpolation.</p>

<dl id="_52ca20e8-b7bf-0bb0-512d-f2a60282615d"><dt>Domain</dt>
<dd id="_abeba03c-8486-28d1-be66-3816c4eaa663"><p id="_02be03b2-cb23-ee30-76df-6d278d4d15e4"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_3e940c74-32fb-d51f-6a40-5bf29a4307c1"><p id="_cb2837f2-9641-f793-94d1-47655d6383ba">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_48169d12-7fc6-1e9b-29f4-7a1124a32aa5"><p id="_c4a3f734-6a1a-f542-5a7d-229f49d1d298">10, 16</p>
</dd>
<dt>Inputs</dt>
<dd id="_7e0fa68b-a6b0-4b56-209c-0cc21c089665"><p id="_a5ef0006-afcb-3c89-027f-12428ce361f7"><tt>X : T1</tt> — Input data tensor from the previous operator; 4-D feature map of shape (N, C, H, W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data.<br/> <tt>rois : T1</tt> — RoIs (Regions of Interest) to pool over; rois is 2-D input of shape (num_rois, 4) given as [[x1, y1, x2, y2], …​]. The RoIs’ coordinates are in the coordinate system of the input image. Each coordinate set has a 1:1 correspondence with the ‘batch_indices’ input.<br/> <tt>batch_indices : T2</tt> — 1-D tensor of shape (num_rois,) with each element denoting the index of the corresponding image in the batch.</p>
</dd>
<dt>Outputs</dt>
<dd id="_e32db4db-7b6f-393f-7297-92e18c2b3af1"><p id="_5e18eea1-b0e3-92ad-a0b0-503cee8c412e"><tt>Y : T1</tt> — RoI pooled output, 4-D tensor of shape (num_rois, C, output_height, output_width). The r-th batch element Y[r-1] is a pooled feature map corresponding to the r-th RoI X[r-1].</p>
</dd>
<dt>Attributes</dt>
<dd id="_d5020dad-e1e5-545c-1308-03cb2a8d459d"><p id="_f4ae6ec6-0ac2-b200-881b-39041076247e"><tt>coordinate_transformation_mode : string (default is half_pixel)</tt> — Allowed values are ‘half_pixel’ and ‘output_half_pixel’. Use the value ‘half_pixel’ to pixel shift the input coordinates by -0.5 (the recommended behavior). Use the value ‘output_half_pixel’ to omit the pixel shift for the input (use this for a backward-compatible behavior).<br/> <tt>mode : string (default is avg)</tt> — The pooling method. Two modes are supported: ‘avg’ and ‘max’. Default is ‘avg’.<br/> <tt>output_height : int (default is 1)</tt> — default 1; Pooled output Y’s height.<br/> <tt>output_width : int (default is 1)</tt> — default 1; Pooled output Y’s width.<br/> <tt>sampling_ratio : int (default is 0)</tt> — Number of sampling points in the interpolation grid used to compute the output value of each pooled output bin. If &gt; 0, then exactly sampling_ratio x sampling_ratio grid points are used. If == 0, then an adaptive number of grid points are used (computed as ceil(roi_width / output_width), and likewise for height). Default is 0.<br/> <tt>spatial_scale : float (default is 1.0)</tt> — Multiplicative spatial scale factor to translate ROI coordinates from their input spatial scale to the scale used when pooling, i.e., spatial scale of the input feature map X relative to the input image. E.g.; default is 1.0f.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_0a38b386-0d4e-1530-d19f-11f678484507"><p id="_aae0a385-24e7-272c-7ab9-261161f49cf0"><tt>T1 : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain types to float tensors.<br/> <tt>T2 : tensor(int64)</tt> — Constrain types to int tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_46f4af65-f75d-1363-1181-6b4cbea8ad1d"><p id="_5c268192-1ea4-a444-5ea8-58e12c0c351b"><tt>test_roialign_aligned_false</tt>, <tt>test_roialign_aligned_true</tt>, <tt>test_roialign_mode_max</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_d708daba-b950-a025-0ffd-c8baa13a7e79"><p id="_ded2827e-2898-ac28-02d7-753322f6dc7b">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_ae739414-2aed-1c72-009d-eef8c9e757d4" anchor="op-ai-onnx-default-rotaryembedding" obligation="normative">
<title id="_85ac2be4-05c5-c1b2-0aa7-4847ef96d5c1">RotaryEmbedding</title>
<p id="_1fb74970-7fed-4e8d-f603-777c2e2c090e">RotaryEmbedding is the implementation of rotary positional embeddings (RoPE) based on the paper <link target="https://arxiv.org/pdf/2104.09864"/>. The key advantage of RoPE is that it allows the model to understand both the absolute position of a token and the relative distances between tokens. This is achieved through a rotational mechanism where the extent of rotation is computed based on the token’s absolute position (position_ids).</p>

<p id="_3fdd0ab2-59fa-5984-9cf2-30fa763fe191">The rotational mechanism is defined by sine and cosine functions that are used to represent the rotation angles. For each token in the sequence, its positional embedding is computed by rotating its embedding vector. This is done by splitting the embedding vector either into two halves or interleaving every alternate token and applying the rotation matrix to each half of the embedding vector. The rotation matrix is parameterized by the token’s position in the sequence. The rotated halves of the embedding vector are concatenated to form the final positional embedding for each token. The rotated positional embeddings are used in the self-attention mechanism. The rotation ensures that the model captures both absolute and relative positional information.</p>

<p id="_4e3ed876-f8e7-2fda-5e1c-ebe9002ca100">Rotary embeddings are defined using the following algorithm:</p>

<sourcecode id="_675d0806-2223-303c-b06e-a5dad3d237e0" lang="python" unnumbered="true"><body>def rotary_embedding(
    input: np.ndarray,
    cos_cache: np.ndarray,
    sin_cache: np.ndarray,
    position_ids: np.ndarray | None = None,
    interleaved=None,
    rotary_embedding_dim=None,
    num_heads=None,
) -&gt; np.ndarray:
    original_input_shape = input.shape
    # First ensure input to be processed has shape [batch_size, seq_len, num_heads, head_size]
    if len(input.shape) == 4:
        input = np.transpose(input, (0, 2, 1, 3))
    batch_size = input.shape[0]
    sequence_length = input.shape[1]
    if len(input.shape) == 3:
        hidden_size = input.shape[2]
        assert num_heads != 0
        head_size = int(hidden_size / num_heads)
        new_shape = [batch_size, sequence_length, num_heads, head_size]
        input = np.reshape(input, new_shape)
    assert len(input.shape) == 4
    head_size = input.shape[3]

    # Fully or partially perform rotation on input based on rotary_embedding_dim attribute
    if rotary_embedding_dim is None or rotary_embedding_dim == 0:
        # If rotary_embedding_dim not provided, perform full rotation by using head_size
        rotary_embedding_dim = head_size
    x_rotate = input[:, :, :, :rotary_embedding_dim]
    x_not_rotate = input[:, :, :, rotary_embedding_dim:]
    rotary_embedding_dim_half = int(rotary_embedding_dim / 2)

    # Retrieve sin and cos caches using position ids
    if position_ids is not None:
        cos_cache = cos_cache[
            position_ids
        ]  # Shape: [batch_size, sequence_length, rotary_embedding_dim/2]
        sin_cache = sin_cache[
            position_ids
        ]  # Shape: [batch_size, sequence_length, rotary_embedding_dim/2]

    # Shape: [batch_size, sequence_length, rotary_embedding_dim/2]
    if cos_cache.shape[-1] != rotary_embedding_dim_half:
        raise ValueError(
            f"Last dimension of cos cache ({cos_cache.shape[-1]}) does not match rotary_embedding_dim/2 ({rotary_embedding_dim_half})."
        )
    if sin_cache.shape[-1] != rotary_embedding_dim_half:
        raise ValueError(
            f"Last dimension of sin cache ({sin_cache.shape[-1]}) does not match rotary_embedding_dim/2 ({rotary_embedding_dim_half})."
        )

    cos_cache = np.expand_dims(
        cos_cache, axis=2
    )  # Shape: [batch_size, sequence_length, 1, rotary_embedding_dim/2]
    sin_cache = np.expand_dims(
        sin_cache, axis=2
    )  # Shape: [batch_size, sequence_length, 1, rotary_embedding_dim/2]

    # Either divide the input in halves or interleave (based on interleaved attribute)
    if interleaved:
        x1 = x_rotate[:, :, :, 0::2]
        x2 = x_rotate[:, :, :, 1::2]
    else:
        x1, x2 = np.split(x_rotate, 2, axis=-1)

    # Calculate real and imaginary values
    real = (cos_cache * x1) - (sin_cache * x2)
    imag = (sin_cache * x1) + (cos_cache * x2)

    # Inserted rotated embeddings back to the original input
    if interleaved:
        # x_rotate[:, :, :, 0::2] = real
        # x_rotate[:, :, :, 1::2] = imag
        real = np.expand_dims(real, axis=-1)
        imag = np.expand_dims(imag, axis=-1)
        x_rotate_concat = np.concatenate((real, imag), axis=-1)
        x_rotate = np.reshape(x_rotate_concat, x_rotate.shape)
    else:
        x_rotate = np.concatenate((real, imag), axis=-1)
    output = np.concatenate((x_rotate, x_not_rotate), axis=-1)
    if len(original_input_shape) == 3:
        output = np.reshape(output, original_input_shape)
    else:
        output = np.transpose(output, (0, 2, 1, 3))
    return output</body></sourcecode>


<dl id="_c814bdaa-1bd0-c652-fc7c-40636cc8e8cb"><dt>Domain</dt>
<dd id="_152e1c0f-7cf5-1699-11c4-47ec0319240e"><p id="_b88728a1-40f7-da15-5964-76ecedfb8993"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_67279100-fcd3-217b-a380-b471c69200fe"><p id="_197149fd-0ed8-f9c7-3ade-f5f8d4041b71">23</p>
</dd>
<dt>Inputs (3 — 4)</dt>
<dd id="_c0978090-977d-ca91-cfa0-73a7a133dd40"><p id="_f6bac113-9cf8-00b6-5b96-a6ce08c9fac9"><tt>X : T</tt> — The input tensor representing the token embeddings. 4D tensor with shape <tt>(batch_size, num_heads, sequence_length, head_size)</tt> or 3D tensor with shape <tt>(batch_size, sequence_length, hidden_size)</tt>. For cases with a 4D input tensor, <tt>head_size</tt> has to be even. For cases with a 3D input tensor, <tt>num_heads</tt> attribute must be provided and <tt>hidden_size</tt> must be an even multiple of <tt>num_heads</tt> where <tt>hidden_size = num_heads * head_size</tt><br/> <tt>cos_cache : T</tt> — The cosine values for the rotation. 2D tensor with shape <tt>(max_position_id_plus_1, head_size / 2)</tt> for full rotation or <tt>(max_position_id_plus_1, rotary_embedding_dim / 2)</tt> for partial rotation when <tt>position_ids</tt> are provided. 3D tensor with shape <tt>(batch_size, sequence_length, head_size / 2)</tt> for full rotation or <tt>(batch_size, sequence_length, rotary_embedding_dim / 2)</tt> for partial rotation when <tt>position_ids</tt> are not provided. <tt>max_position_id_plus_1</tt> is a parameter to the model.<br/> <tt>sin_cache : T</tt> — The sine values for the rotation. 2D tensor with shape <tt>(max_position_id_plus_1, head_size / 2)</tt> for full rotation or <tt>(max_position_id_plus_1, rotary_embedding_dim / 2)</tt> for partial rotation when <tt>position_ids</tt> are provided. 3D tensor with shape <tt>(batch_size, sequence_length, head_size / 2)</tt> for full rotation or <tt>(batch_size, sequence_length, rotary_embedding_dim / 2)</tt> for partial rotation when <tt>position_ids</tt> are not provided. <tt>max_position_id_plus_1</tt> is a parameter to the model.<br/> <tt>position_ids (optional) : M</tt> — The position indices for the tokens. 2D tensor with shape <tt>(batch_size, sequence_length)</tt></p>
</dd>
<dt>Outputs</dt>
<dd id="_ea6c0d4c-3fcc-0afe-d500-131aa57ace5d"><p id="_f8957116-f679-30b2-5a1f-96fbc13325cd"><tt>Y : T</tt> — Tensor with same shape as input.</p>
</dd>
<dt>Attributes</dt>
<dd id="_5b810d8b-7448-7071-f2fc-3037b93ee691"><p id="_8dc929dc-b75a-ce96-4113-c3e271a1bbe2"><tt>interleaved : int (default is 0)</tt> — Rotate using interleaved pattern. Default value is 0 (False).<br/> <tt>num_heads : int</tt> — Number of attention heads. Must be provided when input is a 3D tensor.<br/> <tt>rotary_embedding_dim : int (default is 0)</tt> — Rotary embedding dimension used to apply partial rotary embeddings.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_c72272ff-d260-cb44-9c3b-e73cfb79897e"><p id="_79ba535a-f2ae-7e81-30f7-ad621f271a50"><tt>T : tensor(float), tensor(float16), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.<br/> <tt>M : tensor(int64)</tt> — Constrain input and output types to integer tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_30348f19-3c4d-2b65-0eff-a6317c9ed988"><p id="_d5f888c5-72a2-e289-9a89-544113214006"><tt>test_rotary_embedding</tt>, <tt>test_rotary_embedding_3d_input</tt>, <tt>test_rotary_embedding_interleaved</tt>, <tt>test_rotary_embedding_no_position_ids</tt>, <tt>test_rotary_embedding_no_position_ids_interleaved</tt>, <tt>test_rotary_embedding_no_position_ids_rotary_dim</tt>, <tt>test_rotary_embedding_with_interleaved_rotary_dim</tt>, <tt>test_rotary_embedding_with_rotary_dim</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_bea62750-28c2-0ea1-0d7c-7b22f7d6f446"><p id="_541a471e-97b3-6b31-8db4-fb324f9b665c">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_107a63e5-6f2e-339c-271f-c57084cb3e09" anchor="op-ai-onnx-default-round" obligation="normative">
<title id="_718a914f-4e1f-e0a8-5c48-8e60e50e03dd">Round</title>
<p id="_58f49b53-dd93-6b6e-7977-3169415e031b">Round takes one input Tensor and rounds the values, element-wise, meaning it finds the nearest integer for each value. In case of halves, the rule is to round them to the nearest even integer. If input x is integral, +0, -0, NaN,  or infinite, x itself is returned. The output tensor has the same shape and type as the input.</p>

<p id="_cb835a3a-0cd4-eca5-31ae-54173a85b0dc">Examples:</p>

<sourcecode id="_c2ee2e73-bd23-9d0f-cd6c-eebabf2fe441" unnumbered="true"><body>round([0.9]) = [1.0]
round([2.5]) = [2.0]
round([2.3]) = [2.0]
round([1.5]) = [2.0]
round([-4.5]) = [-4.0]</body></sourcecode>


<dl id="_4fb9c203-5146-32c8-1d17-686dcb382076"><dt>Domain</dt>
<dd id="_d670ec88-9a07-9a93-33f5-e0b12ee8f206"><p id="_a940f7ce-cb11-c7c3-dd83-bc7f25e6ee8e"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_52bd14ae-7c3c-9562-5d0f-d8ddba0a4f4c"><p id="_fe68e19b-ffd5-3398-3cb1-0d7a1d11f94d">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_af6ed9c7-1124-b5a3-2983-3692183a471e"><p id="_cda85e2f-9a44-f380-9b0b-2830ff9fa993">11</p>
</dd>
<dt>Inputs</dt>
<dd id="_382927ba-1419-bad1-03dc-5695bde91d29"><p id="_8c488fe7-2550-3941-d55c-5ed97b90ef63"><tt>X (non-differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_de6da71a-e7ab-b984-7d46-f144370acccd"><p id="_07416ccb-8cb9-e0b0-5dcb-921581243fc7"><tt>Y (non-differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_367a2036-8876-b539-e245-5b932a3a5722"><p id="_f004ad0c-fffe-229e-21da-e20d65514c7b">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_51d13d4c-e2c7-155b-7d46-d1cf9a777dee"><p id="_600c81bc-382f-cf1c-d85d-aca8355f9953"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_35ccf030-a562-c11f-0821-64e9aab879a1"><p id="_8d1b9789-4a8d-8a18-8a71-debb708a701e"><tt>test_round</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_5bf4371a-ff58-b8d3-6756-e8508d619df2"><p id="_d7f19ce1-a80e-59e2-33fa-c22bb240afe9">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_adb5067c-bfa8-5cdd-bfbb-37ad99e4ae37" anchor="op-ai-onnx-default-stft" obligation="normative">
<title id="_d286a0bd-56c4-6a39-45a9-ec037f219dbe">STFT</title>
<p id="_a67a62e6-830b-6136-d94c-f1d880c3ed83">Computes the Short-time Fourier Transform of the signal.</p>

<p id="_6ed30944-2be3-5669-3d6b-49742b610875">The STFT is computed by sliding a window of length <tt>frame_length</tt> over the signal with a step size of  <tt>frame_step</tt>, computing a DFT of each windowed frame.</p>

<p id="_ccd5a9d7-058e-8a45-d0ef-05469d3d7181">The number of frames in the output is computed as:</p>

<p id="_344c6c1a-2a17-7026-4b3e-12dfda1f9233"><tt>frames = floor((signal_length - frame_length) / frame_step) + 1</tt></p>

<p id="_f187e81e-5b0a-82a8-cee1-f939a71e4a55">Constraints on inputs:</p>

<ul id="_cbae2094-320d-d4d5-db9a-85a2d41692a3"><li><p id="_527cd422-24d5-9c4f-8f4b-d45f98bde904"><tt>frame_step</tt> must be a scalar.</p>
</li>
<li><p id="_089fe5c7-64c2-47a1-0e1d-dfd2f931f51f"><tt>frame_length</tt> must be a scalar. When omitted and <tt>window</tt> is provided, <tt>frame_length</tt> is inferred from  <tt>window.shape[0]</tt>. When both <tt>window</tt> and <tt>frame_length</tt> are omitted, <tt>frame_length</tt> defaults to <tt>signal_length</tt>.</p>
</li>
<li><p id="_1dcf17d1-2cfd-e8c5-31df-41f2df82a7c0"><tt>window</tt> must be a 1-D tensor. When omitted, a rectangular (all-ones) window of length <tt>frame_length</tt> is used. When both <tt>window</tt> and <tt>frame_length</tt> are provided, the length of the  <tt>window</tt> tensor must equal <tt>frame_length</tt>.</p>
<dl id="_4513c5d6-aa26-1a34-8b9c-8b931f6233ab"><dt>Domain</dt>
<dd id="_516d2464-5504-36fd-aa23-2da69f78ba12"><p id="_9f0bbfdc-165c-15b1-11f8-8d60baf1957e"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_cea74c5e-7cc2-1c50-3456-abc4f01b9485"><p id="_7d533bd5-ca0a-aa79-bd7a-aa01a3082973">17</p>
</dd>
<dt>Inputs (2 — 4)</dt>
<dd id="_f5fba7f9-0816-3591-99b8-fd3ab3041b01"><p id="_2439f42d-294c-8d76-0636-25929b85f04d"><tt>signal (non-differentiable) : T1</tt> — Input tensor representing a real or complex valued signal. For real input, the following shape is expected: [batch_size][signal_length][1]. For complex input, the following shape is expected: [batch_size][signal_length][2], where [batch_size][signal_length][0] represents the real component and [batch_size][signal_length][1] represents the imaginary component of the signal. The tensor is expected to have rank 3.<br/> <tt>frame_step (non-differentiable) : T2</tt> — A scalar representing the number of samples to step between successive DFTs.<br/> <tt>window (optional, non-differentiable) : T1</tt> — An optional 1-D tensor representing the window function to be applied to each frame of the signal before computing the DFT. The length of the window (window.shape[0]) determines the frame length when <tt>frame_length</tt> is not specified. If both <tt>window</tt> and <tt>frame_length</tt> are provided, the length of the <tt>window</tt> must equal <tt>frame_length</tt>. When omitted, a rectangular (all-ones) window of length <tt>frame_length</tt> is used.<br/> <tt>frame_length (optional, non-differentiable) : T2</tt> — An optional scalar representing the length of each frame (i.e., the DFT size). When omitted and <tt>window</tt> is provided, <tt>frame_length</tt> is inferred from <tt>window.shape[0]</tt>. When both <tt>window</tt> and <tt>frame_length</tt> are omitted, <tt>frame_length</tt> defaults to <tt>signal_length</tt>. If both <tt>frame_length</tt> and <tt>window</tt> are provided, the length of the <tt>window</tt> must equal <tt>frame_length</tt>.</p>
</dd>
<dt>Outputs</dt>
<dd id="_136697f0-945a-24fb-59f5-3602be8ff40e"><p id="_7a36c792-1b20-48b2-6745-5ad534469ecf"><tt>output (non-differentiable) : T1</tt> — The Short-time Fourier Transform of the signal. The number of frames in the output is <tt>frames = floor((signal_length - frame_length) / frame_step) + 1</tt>. If onesided is 1, the output has the shape: [batch_size][frames][dft_unique_bins][2], where dft_unique_bins is frame_length // 2 + 1 (the unique components of the DFT). If onesided is 0, the output has the shape: [batch_size][frames][frame_length][2], where frame_length is the length of the DFT. The last dimension of size 2 represents the real and imaginary parts of each complex value.</p>
</dd>
<dt>Attributes</dt>
<dd id="_7dc4bfa6-92a5-c79d-27d2-d22a8894a421"><p id="_aa5ff6f0-e659-4253-5335-3e6cd7318a03"><tt>onesided : int (default is 1)</tt> — If onesided is 1, only values for w in [0, 1, 2, …​, floor(n_fft/2) + 1] are returned because the real-to-complex Fourier transform satisfies the conjugate symmetry, i.e., X[m, w] = X[m, n_fft-w]*. Note if the input or window tensors are complex, then onesided output is not possible. Enabling onesided with real inputs performs a Real-valued fast Fourier transform (RFFT). When invoked with real or complex valued input, the default value is 1. Values can be 0 or 1.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_bba21b9f-116b-f741-c5ad-13faede11ed8"><p id="_782cface-e6ca-32ad-4b9c-742e357e1ae2"><tt>T1 : tensor(float), tensor(float16), tensor(double), tensor(bfloat16)</tt> — Constrain signal and output to float tensors.<br/> <tt>T2 : tensor(int32), tensor(int64)</tt> — Constrain scalar length types to int64_t.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_d20c1137-ba72-4b83-bffc-a2b2550dd2a5"><p id="_fe5f73f3-8385-6b86-0b48-8b24ab313503"><tt>test_stft</tt>, <tt>test_stft_with_window</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_f1b4d53b-9e99-c78e-a7fa-4c48759a3d69"><p id="_86b6073d-eb59-c6bc-6cca-3d566fd3ba10">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</li>
</ul>
</clause>

<clause id="_b26bdbd9-abd9-8dec-d653-3461d7e7a2a5" anchor="op-ai-onnx-default-scan" obligation="normative">
<title id="_6fc0d331-5f26-e585-a733-3a2ecccf2fdf">Scan</title>
<p id="_60e1e10a-8153-9a0f-5bc3-b50d40bbe7d5">Scan can be used to iterate over one or more scan_input tensors, constructing zero or more scan_output tensors. It combines ideas from general recurrences, functional programming constructs such as scan, fold, map, and zip, and is intended to enable generalizations of RNN-like constructs for sequence-to-sequence processing. Other tensors (referred to as state_variables here) can be used to carry a state when iterating from one element to another (similar to hidden-state in RNNs, also referred to as loop-carried dependences in the context of loops). Many common usages involve a single scan_input tensor (where functionality similar to scan, fold and map can be obtained). When more than one scan_input is used, a behavior similar to zip is obtained.</p>

<p id="_9ce2d9f8-5578-847e-693d-8d5f8a947be6">The attribute body must be a graph, specifying the computation to be performed in every iteration. It takes as input the current values of the state_variables and the current iterated element of the scan_inputs. It must return the (updated) values of the state_variables and zero or more scan_output_element tensors. The values of the scan_output_element tensors are concatenated over all the iterations to produce the scan_output values of the scan construct (similar to the concatenated intermediate hidden-state values of RNN-like constructs). All the output tensors (state_variables as well as scan_output_element tensors) are required to have the same shape in each iteration of the loop (a restriction imposed to enable efficient memory allocation).</p>

<p id="_9181ef69-0a38-c8aa-3798-1ef8ad1e4c81">Note that the iterated element passed to the body subgraph does not have a sequence axis. It will have a rank one less than the rank of the corresponding scan_input.</p>

<p id="_d382d52c-4ed5-cd21-fc18-ecee6130e335">The scan operation returns the final values of the state_variables as well as the scan_outputs.</p>

<p id="_fd495bc9-9a83-f161-8601-31f41aa3e390">The optional attribute scan_input_directions specifies the direction (forward or backward) for each scan input. If this attribute is omitted, all sequences are scanned in the forward direction. A bidirectional scan may be performed by specifying the same tensor input twice in the scan_inputs, once with a forward direction, and once with a backward direction.</p>

<p id="_e96c789e-cbef-b79c-d4d0-0bd3d75efd96">The scan_output of the operation is produced by concatenating the scan_output_element values produced by the body in each iteration.  The optional attribute scan_output_directions specifies the direction in which scan_output is constructed (by appending or prepending the scan_output_element to scan_output in each iteration) for each scan_output. If this attribute is omitted, the scan_output_element is appended to the scan_output in each iteration.</p>

<p id="_a913361e-1692-da1c-e8ae-b3cfbb5991b1">The optional attribute scan_input_axes specifies the axis to be scanned for each scan_input. If omitted, every scan_input will be scanned in axis 0. For example, if axis 0 is the batch axis and axis 1 is the time axis (to be scanned), specify an axis value of 1. Note that scanning a non-zero axis may be less efficient than scanning axis zero.</p>

<p id="_eb1f8087-06d5-efc1-e854-daf10ae0e382">The optional attribute scan_output_axes specifies the axis along which the scan_outputs are accumulated for each scan_output. For example, if axis 1 is the time axis (to be scanned) for both inputs and outputs, specify a scan_input axis and scan_output axis value of 1.</p>

<p id="_1deb100e-6542-0d97-1874-95d2d6811630">Note that because of the ONNX restriction that only the last parameter of an operator can be variadic, the initial-states and scan-inputs are listed together as one input parameter. Similarly, the final-states and scan-outputs are listed together as one output parameter. The attribute num_scan_inputs indicates the number M of scan-inputs.</p>

<p id="_289ecb78-5986-af67-a0ae-36e31b8749a4">The behavior of</p>

<sourcecode id="_e6006cfa-46f0-4b13-5d81-94270470378d" unnumbered="true"><body> Scan &lt;
     num_scan_inputs = m,
     body = loop-body,
     scan_input_axes = [axis_1, ..., axis_m]
 &gt; (init_1, ..., init_n, scan_1, ..., scan_m)</body></sourcecode>


<p id="_df0efb1d-03ad-809c-ff29-269db20ed16e">is equivalent to the following pseudo-code:</p>

<sourcecode id="_4aa0d2f8-9c70-eef6-5200-e7c0c53c469d" unnumbered="true"><body>// scan_i.shape[axis_i] denotes the (max) sequence-length of scan_i
// scan_i.shape[axis_i] is required to be equal to scan_j.shape[axis_j] for all i,j.
sequence_length = scan_1.shape[axis_1];

// initialize state-variables
st_1 = init_1; ... st_n = init_n;
// initialize scan-output variables: [] denotes an empty tensor
scan_out_1 = []; ...; scan_out_k = [];
// identify number of iterations:

// execute loop
for (int t = 0; t &lt; sequence_length; ++t) {
    // generate the scan-input elements: the notation `T&lt;axis=k&gt;`[t] indicates the sub-tensor
    // of rank one less than T obtained by indexing T at position t along axis k.
    si_1 = `scan_1&lt;axis=axis_1&gt;`[t];
    ... ;
    si_m = `scan_m&lt;axis=axis_m&gt;`[t];
    // execute loop-body
    st_1, ..., st_n, so_1, ..., so_k = loop-body(st_1, ..., st_n, si_1, ..., si_m)
    // accumulate the scan-output elements
    scan_out_1 = `Concat&lt;axis=0&gt;`(scan_out_1, so_1); ... ; scan_out_k = `Concat&lt;axis=0&gt;`(scan_out_k, so_k);
}

return st_1, ..., st_n, scan_out_1, ..., scan_out_k;</body></sourcecode>


<p id="_06f71e81-a707-6b99-7b4a-83460b3308b3"><em>Sample usage: Encoding RNN using a Scan</em></p>

<p id="_f7796310-89af-b84c-ad64-11f201355106">The following example shows how a simple RNN over an input tensor %X, with weight tensor %Wi, recurrence weight tensor %Ri, bias tensors %Wbi and %Rbi, and initial hidden-state %H_0 can be encoded as a ScanLoop. Note that the loop-body is a nested graph, and it directly computes %Wi, %Ri, %Wbi, and %Rbi (typically constants or initializers in the body graph). If these values are computed in the outer graph, they need to be passed in as extra state_variables.</p>

<sourcecode id="_b4db6e69-e3a7-bd04-3b27-1f8d7c86e17b" unnumbered="true"><body>graph rnn-encoding {
  %H_0 = ...
  %X = ...
  %Y_h, %Y = Scanbody = &lt;graph rnn-cell-1&gt;, num_scan_inputs=1
  return %Y, %Y_h
}

graph rnn-cell-1 (
  %H_tminus1[FLOAT, tensor]
  %X_t[FLOAT, tensor]
) {
  %Wi = ...
  %Ri = ...
  %Wbi = ...
  %Rbi = ...
  %t1 = X_t * (Wi^T)
  %t2 = H_tminus1*(Ri^T)
  %t3 = Add(%t1, %t2)
  %t4 = Add(%t3, %Wbi)
  %t5 = Add(%t4, %Rbi)
  %Ht = Tanh(%t5)
  %Accumulate = Identity(%Ht)
  return %Ht, %Accumulate
}</body></sourcecode>


<dl id="_9a10adb9-ad60-4b2a-896a-9f5b406bf0e2"><dt>Domain</dt>
<dd id="_5c817fe3-df68-ddbc-9939-94432d3bc654"><p id="_3619172c-c769-592c-9835-558417e19d7a"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_ec824943-f09f-fe23-fa8e-37c5210b0646"><p id="_6542f250-72ed-5b57-82e1-6e62b46e00a0">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_8becd1ad-e90a-1598-7cfb-fc255d8deb50"><p id="_101fbfcb-83c2-1e1f-d45c-f110bbb58cf9">8, 9, 11, 16, 19, 21, 23, 24</p>
</dd>
<dt>Inputs (1 — unbounded)</dt>
<dd id="_15f08512-5caf-7782-ea86-3a5c010b6b38"><p id="_e01a4ddc-c1b9-4243-357c-e2cdeae25454"><tt>initial_state_and_scan_inputs (variadic, heterogeneous) : V</tt> — Initial values of the loop’s N state variables followed by M scan_inputs</p>
</dd>
<dt>Outputs (1 — unbounded)</dt>
<dd id="_e7150504-b031-1203-6d7c-2b50c65dc098"><p id="_31dfbab7-088a-b162-8fb3-236ed444e9d2"><tt>final_state_and_scan_outputs (variadic, heterogeneous) : V</tt> — Final values of the loop’s N state variables followed by K scan_outputs</p>
</dd>
<dt>Attributes</dt>
<dd id="_af35722a-c250-6826-4f6e-ad8895f9a635"><p id="_927c452b-2985-e2af-884d-d988e2a734fc"><tt>body : graph (required)</tt> — The graph run each iteration. It has N+M inputs: (loop state variables…​, scan_input_elts…​). It has N+K outputs: (loop state variables…​, scan_output_elts…​). Each scan_output is created by concatenating the value of the specified scan_output_elt value at the end of each iteration of the loop. It is an error if the dimensions of these values change across loop iterations.<br/> <tt>num_scan_inputs : int (required)</tt> — An attribute specifying the number of scan_inputs M.<br/> <tt>scan_input_axes : list of ints</tt> — An optional list of M flags. The i-th element of the list specifies the axis to be scanned (the sequence axis) for the i-th scan_input. If omitted, 0 will be used as the scan axis for every scan_input. Negative value for an axis means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(input).<br/> <tt>scan_input_directions : list of ints</tt> — An optional list of M flags. The i-th element of the list specifies the direction to be scanned for the i-th scan_input tensor: 0 indicates forward direction and 1 indicates reverse direction. If omitted, all scan_input tensors will be scanned in the forward direction.<br/> <tt>scan_output_axes : list of ints</tt> — An optional list of K flags. The i-th element of the list specifies the axis for the i-th scan_output. The scan outputs are accumulated along the specified axis. If omitted, 0 will be used as the scan axis for every scan_output. Negative value for an axis means counting dimensions from the back. Accepted range is [-r, r-1].<br/> <tt>scan_output_directions : list of ints</tt> — An optional list of K flags, one for each scan_output. The i-th element of the list specifies whether the i-th scan_output should be constructed by appending or prepending a new value in each iteration: 0 indicates appending and 1 indicates prepending. If omitted, all scan_output tensors will be produced by appending a value in each iteration.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_051534fe-898a-7ec8-f188-3b1ada0d21fe"><p id="_f5c26851-120a-55b5-3a34-88798a64a185"><tt>V : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2)</tt> — All Tensor types up to IRv13.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_e5728272-0746-dafa-d4fc-207c599f0376"><p id="_103c2e1c-817b-bcb9-1629-8f7f473a05fb"><tt>test_scan_sum</tt>, <tt>test_scan9_sum</tt>, <tt>test_scan9_multi_state</tt>, <tt>test_scan9_scalar</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_29d0c0dd-2f22-3f2e-5f7b-e98bc9577663"><p id="_4575a0ed-b4bb-360a-e8b1-3a578e7b83fe">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_7d2fdbb4-168d-0147-a489-378850cbe973" anchor="op-ai-onnx-default-scatter" obligation="normative">
<title id="_1055a00f-77d9-ffc5-e2f7-2077a5d2bed9">Scatter</title>
<p id="_6761cfc5-0637-fa2d-74be-68cd71a0c5f0">This operator is deprecated. Please use ScatterElements, which provides the same functionality.</p>

<p id="_70962500-0275-82f7-43dd-06cfdda7d5a5">Scatter takes three inputs <tt>data</tt>, <tt>updates</tt>, and <tt>indices</tt> of the same rank r &gt;= 1 and an optional attribute axis that identifies an axis of  <tt>data</tt> (by default, the outer-most axis, that is axis 0). The output of the operation is produced by creating a copy of the input  <tt>data</tt>, and then updating its value to values specified by  <tt>updates</tt> at specific index positions specified by <tt>indices</tt>. Its output shape is the same as the shape of <tt>data</tt>.</p>

<p id="_e7db08a8-a39c-217c-9b4a-5f3b731dd6c5">For each entry in <tt>updates</tt>, the target index in <tt>data</tt> is obtained by combining the corresponding entry in  <tt>indices</tt> with the index of the entry itself: the index-value for dimension = axis is obtained from the value of the corresponding entry in  <tt>indices</tt> and the index-value for dimension != axis is obtained from the index of the entry itself.</p>

<p id="_6128fd5b-d978-d138-6bf9-1e8feda31a9c">For instance, in a 2-D tensor case, the update corresponding to the [i][j] entry is performed as below:</p>

<sourcecode id="_771197e3-f61e-b3e4-f97d-bb4714cfabe2" unnumbered="true"><body>  output[indices[i][j]][j] = updates[i][j] if axis = 0,
  output[i][indices[i][j]] = updates[i][j] if axis = 1,</body></sourcecode>


<p id="_1ee7f3a3-3019-46c0-015e-29428f45d862">This operator is the inverse of GatherElements. It is similar to Torch’s Scatter operation.</p>

<p id="_47b327da-2d43-ddeb-48e7-c0c8b0ef7c33">Example 1:</p>

<sourcecode id="_d1233dff-d9f3-237c-e4de-70fd782762a1" unnumbered="true"><body>  data = [
      [0.0, 0.0, 0.0],
      [0.0, 0.0, 0.0],
      [0.0, 0.0, 0.0],
  ]
  indices = [
      [1, 0, 2],
      [0, 2, 1],
  ]
  updates = [
      [1.0, 1.1, 1.2],
      [2.0, 2.1, 2.2],
  ]
  output = [
      [2.0, 1.1, 0.0]
      [1.0, 0.0, 2.2]
      [0.0, 2.1, 1.2]
  ]</body></sourcecode>


<p id="_3015cb68-abdd-a835-c256-ad05be6ab01a">Example 2:</p>

<sourcecode id="_78a9a839-8315-e5d6-6b8e-2c4ba65815ab" unnumbered="true"><body>  data = [[1.0, 2.0, 3.0, 4.0, 5.0]]
  indices = [[1, 3]]
  updates = [[1.1, 2.1]]
  axis = 1
  output = [[1.0, 1.1, 3.0, 2.1, 5.0]]</body></sourcecode>


<dl id="_f66c5e33-2927-6458-1ffc-1c19f1bed74a"><dt>Domain</dt>
<dd id="_85fd0f38-d5e0-1a19-5c64-1c2a544bdd64"><p id="_e424527a-cca4-ccf4-85d2-ed0f5707996b"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_d0b58906-9407-1d0b-6403-c2f83a1337da"><p id="_86a228bf-c05e-00e5-5ae0-d8cc9d4de0e8">11</p>
</dd>
<dt>Status</dt>
<dd id="_9791e661-f7e8-3761-f058-62ce3f748b63"><p id="_ac2bd50b-d763-4065-d216-20a630e86626">Deprecated. Clause 14.5 of <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/> applies: a deprecated operator is not removed, and a consumer continues to evaluate it.</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_b6d98493-1025-e08f-b0c0-2a6058752862"><p id="_2e4652a0-2b46-1b20-2b4a-ef3058cdc09d">9</p>
</dd>
<dt>Inputs</dt>
<dd id="_290d9d18-4d61-23a0-f302-a1291b292676"><p id="_4834ac6d-a1cf-4638-eb1a-a08ce3cb44c2">Not stated by the source.</p>
</dd>
<dt>Outputs</dt>
<dd id="_3c8ba444-cf08-3e7e-fb05-e39a3b6180e4"><p id="_a83f0d6b-9f4b-12b8-c2ca-5bfed14df90c">Not stated by the source.</p>
</dd>
<dt>Attributes</dt>
<dd id="_9cf83455-4170-859b-626b-cb3c85f8a455"><p id="_d7ea4ff9-ff5d-2c84-7906-7e0550a58964">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_23a38469-2f9d-7c96-f133-491a32b7591b"><p id="_97bd35b2-7313-e565-e213-1e5cd8341ae7">Not stated by the source.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_3af229da-d496-8c00-b621-ab96c77cd7d7"><p id="_241c4a98-7dff-94f9-ef27-093e1616b2a4"><tt>test_scatter_with_axis</tt>, <tt>test_scatter_without_axis</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_3aa2b3a8-01c1-9bab-7296-b81088c3566b"><p id="_b6dcb73a-af3a-aa3d-7720-7860a0b7d4ee">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_5ea83e12-5aba-2a35-1949-89f056a11e26" anchor="op-ai-onnx-default-scatterelements" obligation="normative">
<title id="_2f51e9bc-e82a-73da-e4d6-0c0d39d8a318">ScatterElements</title>
<p id="_08ffdf88-a95c-8ab5-fda8-c9fbcc088f59">ScatterElements takes three inputs <tt>data</tt>, <tt>updates</tt>, and <tt>indices</tt> of the same rank r &gt;= 1 and an optional attribute axis that identifies an axis of  <tt>data</tt> (by default, the outer-most axis, that is axis 0). The output of the operation is produced by creating a copy of the input  <tt>data</tt>, and then updating its value to values specified by  <tt>updates</tt> at specific index positions specified by <tt>indices</tt>. Its output shape is the same as the shape of <tt>data</tt>.</p>

<p id="_3c158ff2-92e7-bb12-9953-a65133fdf113">For each entry in <tt>updates</tt>, the target index in <tt>data</tt> is obtained by combining the corresponding entry in  <tt>indices</tt> with the index of the entry itself: the index-value for dimension = axis is obtained from the value of the corresponding entry in  <tt>indices</tt> and the index-value for dimension != axis is obtained from the index of the entry itself.</p>

<p id="_5e1507f6-b0d5-ff58-7c93-59411bc94a89"><tt>reduction</tt> allows specification of an optional reduction operation, which is applied to all values in <tt>updates</tt> tensor into  <tt>output</tt> at the specified <tt>indices</tt>. In cases where  <tt>reduction</tt> is set to “none”, indices should not have duplicate entries: that is, if idx1 != idx2, then indices[idx1] != indices[idx2]. For instance, in a 2-D tensor case, the update corresponding to the [i][j] entry is performed as below:</p>

<sourcecode id="_16ac7d46-5ee5-0ea5-3276-5b3ffe1f80a4" unnumbered="true"><body>output[indices[i][j]][j] = updates[i][j] if axis = 0,
output[i][indices[i][j]] = updates[i][j] if axis = 1,</body></sourcecode>


<p id="_0f426a54-ed6b-01bd-d9bd-85580de9b0c2">When <tt>reduction</tt> is set to some reduction function <tt>f</tt>, the update corresponding to the [i][j] entry is performed as below:</p>

<sourcecode id="_bf22cafa-3bf8-c11c-a797-d8972906702e" unnumbered="true"><body>output[indices[i][j]][j] = f(output[indices[i][j]][j], updates[i][j]) if axis = 0,
output[i][indices[i][j]] = f(output[i][indices[i][j]], updates[i][j]) if axis = 1,</body></sourcecode>


<p id="_7e720851-0b2b-6f9d-0258-1ddc71a8914e">where the <tt>f</tt> is <tt>+</tt>, <tt>*</tt>, <tt>max</tt> or <tt>min</tt> as specified.</p>

<p id="_01bf1ff2-c327-f5b6-7db5-bb7148616251">This operator is the inverse of GatherElements. It is similar to Torch’s Scatter operation.</p>

<p id="_77bf45e6-8b9c-32fd-0bdf-dcdcc37fd9ad">(Opset 18 change): Adds max/min to the set of allowed reduction ops.</p>

<p id="_98b3cf8c-8741-9dea-7825-8d3ec32e4757">Example 1:</p>

<sourcecode id="_0a34161d-34e8-16c3-b089-aade0320e060" unnumbered="true"><body>data = [
    [0.0, 0.0, 0.0],
    [0.0, 0.0, 0.0],
    [0.0, 0.0, 0.0],
]
indices = [
    [1, 0, 2],
    [0, 2, 1],
]
updates = [
    [1.0, 1.1, 1.2],
    [2.0, 2.1, 2.2],
]
output = [
    [2.0, 1.1, 0.0]
    [1.0, 0.0, 2.2]
    [0.0, 2.1, 1.2]
]</body></sourcecode>


<p id="_a0f12666-954f-546c-e5b1-818c5009d560">Example 2:</p>

<sourcecode id="_c2cfdada-de66-826d-5ddb-cbe772c75b8a" unnumbered="true"><body>data = [[1.0, 2.0, 3.0, 4.0, 5.0]]
indices = [[1, 3]]
updates = [[1.1, 2.1]]
axis = 1
output = [[1.0, 1.1, 3.0, 2.1, 5.0]]</body></sourcecode>


<dl id="_d0ac83d2-8beb-2dde-74d3-3899bae2896d"><dt>Domain</dt>
<dd id="_d49a4461-e979-badd-ca7a-d9bd5b516adf"><p id="_ba28fe40-e726-0c35-86d2-b8ea4ecd1574"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_bdfa0e9d-18d7-e23d-1269-9c73410cfbae"><p id="_d70c74f7-d348-e419-6b3a-aa04bce05c9f">18</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_16b22862-b4fe-f1f0-0dfc-e90740ff44e5"><p id="_d51f3ab8-82e1-cee6-c80d-f5b3dadb475b">11, 13, 16</p>
</dd>
<dt>Inputs</dt>
<dd id="_f9454eb7-891f-1af4-7143-47bb00e69eff"><p id="_999b80f4-f17f-bf6b-b9fa-5b83f168f4f8"><tt>data (differentiable) : T</tt> — Tensor of rank r &gt;= 1.<br/> <tt>indices (non-differentiable) : Tind</tt> — Tensor of int32/int64 indices, of r &gt;= 1 (same rank as input). All index values are expected to be within bounds [-s, s-1] along axis of size s. It is an error if any of the index values are out of bounds.<br/> <tt>updates (differentiable) : T</tt> — Tensor of rank r &gt;=1 (same rank and shape as indices)</p>
</dd>
<dt>Outputs</dt>
<dd id="_27dd3f3d-c098-38b3-a9c5-1a997c477ab4"><p id="_4dca9da9-8698-94d6-31d1-c4affe3c4798"><tt>output (differentiable) : T</tt> — Tensor of rank r &gt;= 1 (same rank as input).</p>
</dd>
<dt>Attributes</dt>
<dd id="_4061423b-ab93-fd7d-f089-f10d0834c640"><p id="_87a2123b-49ed-f5b6-e989-bc324a4e0bd4"><tt>axis : int (default is 0)</tt> — Which axis to scatter on. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(data).<br/> <tt>reduction : string (default is none)</tt> — Type of reduction to apply: none (default), add, mul, max, min. ‘none’: no reduction applied. ‘add’: reduction using the addition operation. ‘mul’: reduction using the multiplication operation.’max’: reduction using the maximum operation.’min’: reduction using the minimum operation.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_82ca4b2e-dfec-8a97-e3b6-7e56342efe6b"><p id="_df85e23c-17c0-2be1-3b05-f732af62216c"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Input and output types can be of any tensor type.<br/> <tt>Tind : tensor(int32), tensor(int64)</tt> — Constrain indices to integer types</p>
</dd>
<dt>Test vectors</dt>
<dd id="_2688e8ef-cdb8-186c-4eae-b619fda333f9"><p id="_51e45104-1e25-eb8c-b610-5cd06ba354f3"><tt>test_scatter_elements_with_axis</tt>, <tt>test_scatter_elements_with_duplicate_indices</tt>, <tt>test_scatter_elements_with_negative_indices</tt>, <tt>test_scatter_elements_with_reduction_max</tt>, <tt>test_scatter_elements_with_reduction_min</tt>, <tt>test_scatter_elements_with_reduction_mul</tt>, <tt>test_scatter_elements_without_axis</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_cc88ec0d-c858-b625-316f-cc712833ac83"><p id="_bd37703f-9f1b-2117-e147-6ca092f35040">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_9690c519-b278-9e2b-711a-0fe44c6e92c7" anchor="op-ai-onnx-default-scatternd" obligation="normative">
<title id="_87c6ea80-e447-ebfe-6ca6-0a54f409c6cd">ScatterND</title>
<p id="_e6dc38a9-878e-8fec-a5f4-730f5e8f4f07">ScatterND takes three inputs <tt>data</tt> tensor of rank r &gt;= 1, <tt>indices</tt> tensor of rank q &gt;= 1, and  <tt>updates</tt> tensor of rank q + r — indices.shape[-1] — 1. The output of the operation is produced by creating a copy of the input  <tt>data</tt>, and then updating its value to values specified by  <tt>updates</tt> at specific index positions specified by <tt>indices</tt>. Its output shape is the same as the shape of  <tt>data</tt>.</p>

<p id="_900bf560-e57e-dba0-017e-880d866b925f"><tt>indices</tt> is an integer tensor. Let k denote indices.shape[-1], the last dimension in the shape of <tt>indices</tt>. <tt>indices</tt> is treated as a (q-1)-dimensional tensor of k-tuples, where each k-tuple is a partial-index into <tt>data</tt>. Hence, k can be a value at most the rank of  <tt>data</tt>. When k equals rank(data), each update entry specifies an update to a single element of the tensor. When k is less than rank(data) each update entry specifies an update to a slice of the tensor. Index values are allowed to be negative, as per the usual convention for counting backwards from the end, but are expected in the valid range.</p>

<p id="_5c39aa5a-dc63-80f2-8839-d0fb6b86b56c"><tt>updates</tt> is treated as a (q-1)-dimensional tensor of replacement-slice-values. Thus, the first (q-1) dimensions of updates.shape must match the first (q-1) dimensions of indices.shape. The remaining dimensions of  <tt>updates</tt> correspond to the dimensions of the replacement-slice-values. Each replacement-slice-value is a (r-k) dimensional tensor, corresponding to the trailing (r-k) dimensions of  <tt>data</tt>.  Thus, the shape of <tt>updates</tt> must equal indices.shape[0:q-1] ++ data.shape[k:r], where ++ denotes the concatenation of shapes.</p>

<p id="_1f5ecbb6-4001-f61d-2ad1-e0be5f604668">The <tt>output</tt> is calculated via the following equation:</p>

<sourcecode id="_5c64aa03-73ed-d0dd-e2a8-d093a8f0f70b" unnumbered="true"><body>output = np.copy(data)
update_indices = indices.shape[:-1]
for idx in np.ndindex(update_indices):
    output[tuple(indices[idx])] = updates[idx]</body></sourcecode>


<p id="_2cd0d192-7b7f-dc3e-c7b2-a128e8e7f61d">The order of iteration in the above loop is not specified. In particular, indices should not have duplicate entries: that is, if idx1 != idx2, then indices[idx1] != indices[idx2]. This ensures that the output value does not depend on the iteration order.</p>

<p id="_e8ff4bf8-f0c8-7630-a556-4b0d3b6510f1"><tt>reduction</tt> allows specification of an optional reduction operation, which is applied to all values in <tt>updates</tt> tensor into  <tt>output</tt> at the specified <tt>indices</tt>. In cases where  <tt>reduction</tt> is set to “none”, indices should not have duplicate entries: that is, if idx1 != idx2, then indices[idx1] != indices[idx2]. This ensures that the output value does not depend on the iteration order. When  <tt>reduction</tt> is set to some reduction function <tt>f</tt>, <tt>output</tt> is calculated as follows:</p>

<sourcecode id="_72275542-2f7e-7f42-f821-9cd6a07751c4" unnumbered="true"><body>output = np.copy(data)
update_indices = indices.shape[:-1]
for idx in np.ndindex(update_indices):
    output[tuple(indices[idx])] = f(output[tuple(indices[idx])], updates[idx])</body></sourcecode>


<p id="_a48fb0c9-f453-7f66-e630-88f84c656997">where the <tt>f</tt> is <tt>+</tt>, <tt>*</tt>, <tt>max</tt> or <tt>min</tt> as specified.</p>

<p id="_8159ee4d-c0cd-aa1d-4d10-b9be6721cc32">This operator is the inverse of GatherND.</p>

<p id="_f6df8512-fe9d-da52-cf89-3851785b94e2">(Opset 18 change): Adds max/min to the set of allowed reduction ops.</p>

<p id="_bc04ed37-c4c2-76cc-248a-513fd034b89d">Example 1:</p>

<sourcecode id="_c2f0957d-7c7f-311a-f55e-7b080f9c405c" unnumbered="true"><body>data    = [1, 2, 3, 4, 5, 6, 7, 8]
indices = [[4], [3], [1], [7]]
updates = [9, 10, 11, 12]
output  = [1, 11, 3, 10, 9, 6, 7, 12]</body></sourcecode>


<p id="_cc63d6b0-9771-b9a6-0060-390e33497ba3">Example 2:</p>

<sourcecode id="_262b7c99-b10a-4671-1b9b-79775e698852" unnumbered="true"><body>data    = [[[1, 2, 3, 4], [5, 6, 7, 8], [8, 7, 6, 5], [4, 3, 2, 1]],
            [[1, 2, 3, 4], [5, 6, 7, 8], [8, 7, 6, 5], [4, 3, 2, 1]],
            [[8, 7, 6, 5], [4, 3, 2, 1], [1, 2, 3, 4], [5, 6, 7, 8]],
            [[8, 7, 6, 5], [4, 3, 2, 1], [1, 2, 3, 4], [5, 6, 7, 8]]]
indices = [[0], [2]]
updates = [[[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]],
            [[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3], [4, 4, 4, 4]]]
output  = [[[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]],
            [[1, 2, 3, 4], [5, 6, 7, 8], [8, 7, 6, 5], [4, 3, 2, 1]],
            [[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3], [4, 4, 4, 4]],
            [[8, 7, 6, 5], [4, 3, 2, 1], [1, 2, 3, 4], [5, 6, 7, 8]]]</body></sourcecode>


<dl id="_b36fc431-9033-1dbd-6570-d77b8233993c"><dt>Domain</dt>
<dd id="_9503c4d6-e150-7e4e-4663-bb96b9f88458"><p id="_8f703a32-df49-529a-943d-62f659066599"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_9fed5f95-b092-501d-9dcc-82c8897d4859"><p id="_9879bdba-8d7e-08a2-78e9-134e7c5a2ad3">18</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_eda0f72c-ba73-e482-0f98-11ed14b5e670"><p id="_e4a354c7-e6a3-ed73-8d68-cd563f6e491f">11, 13, 16</p>
</dd>
<dt>Inputs</dt>
<dd id="_d1499237-11fc-33d1-f73f-b08aff1b633d"><p id="_62be0e9d-1982-56e2-7d09-2368df598af2"><tt>data (differentiable) : T</tt> — Tensor of rank r &gt;= 1.<br/> <tt>indices (non-differentiable) : tensor(int64)</tt> — Tensor of rank q &gt;= 1.<br/> <tt>updates (differentiable) : T</tt> — Tensor of rank q + r — indices_shape[-1] — 1.</p>
</dd>
<dt>Outputs</dt>
<dd id="_dfae889a-cc33-4ae8-7ace-f51dadec6b0e"><p id="_661dfdca-7228-92c5-e55f-37c3629b8391"><tt>output (differentiable) : T</tt> — Tensor of rank r &gt;= 1.</p>
</dd>
<dt>Attributes</dt>
<dd id="_2a634d09-1b90-fbe0-444a-98238b6f9930"><p id="_d03aa79c-4817-070a-006c-3bbfcbabcf70"><tt>reduction : string (default is none)</tt> — Type of reduction to apply: none (default), add, mul, max, min. ‘none’: no reduction applied. ‘add’: reduction using the addition operation. ‘mul’: reduction using the addition operation. ‘max’: reduction using the maximum operation.’min’: reduction using the minimum operation.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_4e430b53-dc79-9b29-1f74-616a11c5ba68"><p id="_bdca586f-1e51-d537-e1ae-d78032d5d83b"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input and output types to any tensor type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_fb9e1f8e-a1fb-66ee-2f9f-c283fb4c2f0f"><p id="_ec3ed589-f51e-d1e5-b30e-7b32585c31bb"><tt>test_scatternd</tt>, <tt>test_scatternd_add</tt>, <tt>test_scatternd_max</tt>, <tt>test_scatternd_max_with_element_indices</tt>, <tt>test_scatternd_min</tt>, <tt>test_scatternd_min_with_element_indices</tt>, <tt>test_scatternd_multiply</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_cb3d118f-2712-a214-a4da-c11527fff27a"><p id="_3f97e0ea-2bb1-ccda-2ce8-50fb116fd893">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_745e9b06-9520-caed-647d-9ca4f9ce35ee" anchor="op-ai-onnx-default-selu" obligation="normative">
<title id="_41d63bc1-9dd3-7f9d-2c5a-1d6a2293e587">Selu</title>
<p id="_fc321335-d678-3674-8513-038ff9a99098">Selu takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the scaled exponential linear unit function, <tt>y = gamma * (alpha * e^x - alpha) for x &lt;= 0</tt>, <tt>y = gamma * x for x &gt; 0</tt>, is applied to the tensor elementwise.</p>

<dl id="_7ceda531-05e6-8f9c-cdaf-1da4e2d87cb3"><dt>Domain</dt>
<dd id="_81f0fb38-2287-ff97-fa4e-a871769222b6"><p id="_d9494ec8-9d30-8559-a68c-5f18f195b68b"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_6e78fbf9-d16a-a067-1b08-b6e935550cda"><p id="_89fcc2fd-cb5b-ce96-f90b-d68e3dd9f118">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_4d4dad2d-5a05-91c3-9015-80878826eea9"><p id="_5aa3217b-db5b-88d3-20dc-820372ad10b3">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_40d89628-e945-2770-d7f9-cb4b898335bc"><p id="_f268cca6-c0e8-80be-651c-580a886641c4"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_acb4289c-8688-9b73-63d8-90f441f07805"><p id="_7ad50276-babf-62f7-3614-4b69e7faac30"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_8d161096-8efd-54da-4727-8de49def4016"><p id="_e41bb28b-ad80-b8ff-4e4e-839579ab74fb"><tt>alpha : float (default is 1.67326)</tt> — Coefficient of SELU default to 1.67326319217681884765625 (i.e., float32 approximation of 1.6732632423543772848170429916717).<br/> <tt>gamma : float (default is 1.0507)</tt> — Coefficient of SELU default to 1.05070102214813232421875 (i.e., float32 approximation of 1.0507009873554804934193349852946).</p>
</dd>
<dt>Type constraints</dt>
<dd id="_b4d39b31-6602-1418-0f84-4160466346eb"><p id="_cb7bfe6f-0b43-760f-0587-67e7d57a5eae"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_74257a09-9fc0-34e5-788c-89bf275709ed"><p id="_6bd5099d-7fae-3bdb-0dbb-9cff71d9db58"><tt>test_selu_example</tt>, <tt>test_selu</tt>, <tt>test_selu_default</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_38176936-2b77-8290-0059-cb292140ed6e"><p id="_aee20fc8-5ab3-bf8c-e8a4-69a219b8705d">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_11f7e80d-fe97-b348-6cf4-7eeee3cd1b55" anchor="op-ai-onnx-default-sequenceat" obligation="normative">
<title id="_3b6c8798-d1a0-da1a-a5fa-1e0c2f760742">SequenceAt</title>
<p id="_50ca2fb3-3226-c3d3-5f89-117e7771583d">Outputs a tensor copy from the tensor at ‘position’ in ‘input_sequence’. Accepted range for ‘position’ is in  <tt>[-n, n - 1]</tt>, where <tt>n</tt> is the number of tensors in ‘input_sequence’. Negative value means counting positions from the back.</p>

<dl id="_f55e40ca-c53b-89ba-0501-2b8b499ab378"><dt>Domain</dt>
<dd id="_d2bdcb6d-e5d0-755b-e5c0-2fce42c9a402"><p id="_a08680a3-b338-7152-483b-e8b60c3c1c01"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_b0ecc71c-1e0e-a0fb-1c01-991cc3aa290f"><p id="_c2cc163a-57fd-120b-357c-4379891b9b54">11</p>
</dd>
<dt>Inputs</dt>
<dd id="_e0d2051d-0fac-a12a-8476-a27b5b3ecdd5"><p id="_15370daf-9c62-1fb9-dd50-bc1d28d02b33"><tt>input_sequence : S</tt> — Input sequence.<br/> <tt>position : I</tt> — Position of the tensor in the sequence. Negative value means counting positions from the back. Accepted range in <tt>[-n, n - 1]</tt>, where <tt>n</tt> is the number of tensors in ‘input_sequence’. It is an error if any of the index values are out of bounds. It must be a scalar(tensor of empty shape).</p>
</dd>
<dt>Outputs</dt>
<dd id="_4858ed30-7761-44d9-13b7-23ec36c7b41b"><p id="_fc580431-addb-9bdf-14b8-671cc9f4e5f4"><tt>tensor : T</tt> — Output tensor at the specified position in the input sequence.</p>
</dd>
<dt>Attributes</dt>
<dd id="_b767fdb3-bff8-e65a-2339-c3cf2311afb5"><p id="_85d459fd-a216-0914-d4fb-91fd8f44b24f">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_4098c11d-8485-0bc6-d2d2-a6f042f7ed65"><p id="_bb6655db-6f5a-8dc1-798c-81cb589f95b6"><tt>S : seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128))</tt> — Constrain to any tensor type.<br/> <tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain to any tensor type.<br/> <tt>I : tensor(int32), tensor(int64)</tt> — Constrain position to integral tensor. It must be a scalar(tensor of empty shape).</p>
</dd>
<dt>Test vectors</dt>
<dd id="_46e8fcf1-fd37-41c3-39e6-b07e4fe0dbdb"><p id="_e43627b8-e96f-a597-f92e-035b01e9e7b5">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_1c1565e4-8074-78c8-da3c-e36bf83996c7"><p id="_c1ce888e-c615-20c8-69a4-43bed6e007d5">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_ff13d2bf-4f55-7d6d-4466-33a61fcf1c0f" anchor="op-ai-onnx-default-sequenceconstruct" obligation="normative">
<title id="_93f60e0e-421a-1106-41d9-5b5b7bf0fa91">SequenceConstruct</title>
<p id="_c30923eb-ce29-9ff6-70e5-cdd4b7ce725e">Construct a tensor sequence containing ‘inputs’ tensors. All tensors in ‘inputs’ must have the same data type.</p>

<dl id="_8e1f0b51-62c3-2080-9159-cad65a479804"><dt>Domain</dt>
<dd id="_5b6846c4-e244-ea9c-c83f-c07c1062bc7c"><p id="_836fa883-fc4e-271c-5640-7e1b89c32a51"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_47d9206f-d520-b0ff-54a1-05576e75b66e"><p id="_7ce6b764-6705-1a40-fb2f-30d785f08d23">11</p>
</dd>
<dt>Inputs (1 — unbounded)</dt>
<dd id="_9b08def1-008e-77c0-79e9-b7764d44b42b"><p id="_43869853-189b-a6e2-53a9-f6afdb8515b8"><tt>inputs (variadic) : T</tt> — Tensors.</p>
</dd>
<dt>Outputs</dt>
<dd id="_9eb1f05e-1e3a-5404-611d-f3a51cb8c6c0"><p id="_69811f6a-f879-2ba6-a956-791e1784ecf7"><tt>output_sequence : S</tt> — Sequence enclosing the input tensors.</p>
</dd>
<dt>Attributes</dt>
<dd id="_d3e4c2a2-5c11-e790-1757-01a73a66e71b"><p id="_a477505c-f080-28d9-43c2-87ec5a4766dd">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_fe3c0763-d487-d495-68ec-80e6f777ab3a"><p id="_491788c1-fe92-cc11-8175-3f15009931bd"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input types to any tensor type.<br/> <tt>S : seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128))</tt> — Constrain output types to any tensor type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_672be5e6-1d21-de0e-0d17-e2d397441325"><p id="_db90db35-2b05-5d3f-b167-388ea582ca82">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_6daa21e2-9c49-3095-3bb2-400748b0ee09"><p id="_47511bf1-aac9-f8e9-a318-a1b067f7d999">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_04dc9066-3bc8-7136-39d6-9cb82ad1e0e7" anchor="op-ai-onnx-default-sequenceempty" obligation="normative">
<title id="_a349cbd5-f2af-7613-cc83-1eed2d8e6140">SequenceEmpty</title>
<p id="_cd5e9aac-d700-09f2-3556-eb2be9b9de78">Construct an empty tensor sequence, with given data type.</p>

<dl id="_f6a23c68-5d16-96ee-6b5e-5204ccd8691d"><dt>Domain</dt>
<dd id="_178fd8eb-0c64-b167-69c1-212d7fc69d9a"><p id="_c9423c61-0be1-6ae0-db76-7263e1b787b6"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_79ad9434-1d20-4583-feb7-a49bfa1b4163"><p id="_8f87ab9d-ea8f-05de-b1b9-f304b201f534">11</p>
</dd>
<dt>Inputs</dt>
<dd id="_80e80043-cec4-165a-b068-d8f234fa98a8"><p id="_dc590c2f-ba96-7461-f923-98e2e456e83f">None.</p>
</dd>
<dt>Outputs</dt>
<dd id="_66567254-2446-e984-e08f-6fac19c9a584"><p id="_c3211b21-07f3-116b-4fd4-803dede64b24"><tt>output : S</tt> — Empty sequence.</p>
</dd>
<dt>Attributes</dt>
<dd id="_8aac8c35-d824-782e-7fc8-cc7019e4f374"><p id="_d892cdc5-003a-ab1e-ebce-b9c6a0151011"><tt>dtype : int</tt> — (Optional) The data type of the tensors in the output sequence. The default type is ‘float’.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_b10f11d1-fea5-63e0-31a3-dc136048689b"><p id="_7feb6e49-31e0-f05a-167c-c5bb8efd20db"><tt>S : seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128))</tt> — Constrain output types to any tensor type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_8db224a3-914a-dfe3-d788-8f5eafedc6d1"><p id="_6cad9c75-1210-be78-cd4b-3e46769cbedc">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_7504979e-5c57-5c2b-084a-976307a41452"><p id="_ccb0d253-6876-8506-9f99-3171f1728c70">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_e990224f-def7-970a-688e-7ad75a4ad370" anchor="op-ai-onnx-default-sequenceerase" obligation="normative">
<title id="_f3278c09-6de2-d43f-f358-6e088d70a487">SequenceErase</title>
<p id="_3d13a252-0170-0142-5543-85a161f3026e">Outputs a tensor sequence that removes the tensor at ‘position’ from ‘input_sequence’. Accepted range for ‘position’ is in  <tt>[-n, n - 1]</tt>, where <tt>n</tt> is the number of tensors in ‘input_sequence’. Negative value means counting positions from the back. ‘position’ is optional, by default it erases the last tensor from ‘input_sequence’.</p>

<dl id="_1b70ad4a-658d-2581-1296-4ac2f04942e7"><dt>Domain</dt>
<dd id="_d447d076-f1d9-31ce-8927-cb24f6120f4b"><p id="_449519df-78c0-7873-0cb0-ac8636ca8871"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_843f2eff-a965-9a73-8ee7-13875c617639"><p id="_f29d7d37-7784-4910-2d7b-e99d351a56e8">11</p>
</dd>
<dt>Inputs (1 — 2)</dt>
<dd id="_9f7c5f23-27c9-c300-a39c-d744f6e65986"><p id="_6430f16d-0594-65d4-daf7-6469b5d42b34"><tt>input_sequence : S</tt> — Input sequence.<br/> <tt>position (optional) : I</tt> — Position of the tensor in the sequence. Negative value means counting positions from the back. Accepted range in <tt>[-n, n - 1]</tt>, where <tt>n</tt> is the number of tensors in ‘input_sequence’. It is an error if any of the index values are out of bounds. It must be a scalar(tensor of empty shape).</p>
</dd>
<dt>Outputs</dt>
<dd id="_bd9f4d6a-4eb1-d5b7-5cf3-387f928fb987"><p id="_bd36a2f6-3de2-42fb-2297-32f6c53cacdd"><tt>output_sequence : S</tt> — Output sequence that has the tensor at the specified position removed.</p>
</dd>
<dt>Attributes</dt>
<dd id="_644ddf08-4720-fcb6-1636-749178f1dc57"><p id="_915bbc98-6a60-8d12-291e-d8561c8c00ff">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_b1f8fb47-94c8-d280-febe-fcbe567942a5"><p id="_35c496a2-3061-1b57-9eb1-519b6bf03c83"><tt>S : seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128))</tt> — Constrain to any tensor type.<br/> <tt>I : tensor(int32), tensor(int64)</tt> — Constrain position to integral tensor. It must be a scalar(tensor of empty shape).</p>
</dd>
<dt>Test vectors</dt>
<dd id="_f3ffc0db-48bb-850a-dc74-373bd52849d9"><p id="_09e7a865-13cf-c0b5-d558-88861966cc50">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_29897c50-0384-32c8-a322-d061ed30a821"><p id="_3e3e818f-8818-559a-f923-742eeaf089cb">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_3d2e45df-68e1-dc6b-f34e-a4c83b4da2c9" anchor="op-ai-onnx-default-sequenceinsert" obligation="normative">
<title id="_7ef478ce-a8c4-0275-6a7e-649becdf5c16">SequenceInsert</title>
<p id="_a0cd18c5-5904-54cf-ce4e-276106fa67d7">Outputs a tensor sequence that inserts ‘tensor’ into ‘input_sequence’ at ‘position’. ‘tensor’ must have the same data type as ‘input_sequence’. Accepted range for ‘position’ is in  <tt>[-n, n]</tt>, where <tt>n</tt> is the number of tensors in ‘input_sequence’. Negative value means counting positions from the back. ‘position’ is optional, by default it inserts ‘tensor’ to the back of ‘input_sequence’.</p>

<dl id="_dcaf3feb-4880-64bb-6c63-fee50ca7e316"><dt>Domain</dt>
<dd id="_08bab45c-2254-3b5f-d014-8fc665128c42"><p id="_49247a2a-cb99-a7e8-bc08-a493015be063"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_52c96cf6-08ff-89bc-3cd4-de9d2d005230"><p id="_9ab49428-26ce-ce29-b486-49bcb113f57c">11</p>
</dd>
<dt>Inputs (2 — 3)</dt>
<dd id="_a05e072d-8254-7695-27b8-57bf6046a7a9"><p id="_73be32bb-2286-0798-3569-0870e4d456f2"><tt>input_sequence : S</tt> — Input sequence.<br/> <tt>tensor : T</tt> — Input tensor to be inserted into the input sequence.<br/> <tt>position (optional) : I</tt> — Position in the sequence where the new tensor is inserted. It is optional and default is to insert to the back of the sequence. Negative value means counting positions from the back. Accepted range in <tt>[-n, n]</tt>, where <tt>n</tt> is the number of tensors in ‘input_sequence’. It is an error if any of the index values are out of bounds. It must be a scalar(tensor of empty shape).</p>
</dd>
<dt>Outputs</dt>
<dd id="_eb0969c0-5f74-b0a5-6b91-16004e3e78da"><p id="_5362d261-c82a-cf11-6ee5-0c159e91a7fe"><tt>output_sequence : S</tt> — Output sequence that contains the inserted tensor at given position.</p>
</dd>
<dt>Attributes</dt>
<dd id="_b69a32b9-9f0d-ccdd-08b7-a4a8fecc79b1"><p id="_ed626b0f-22ad-3864-329a-543956ce8fa8">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_e48d7d09-74f8-67b5-b431-4a3b17421610"><p id="_6a31917e-d109-7a94-2d97-c755c4240e8f"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain to any tensor type.<br/> <tt>S : seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128))</tt> — Constrain to any tensor type.<br/> <tt>I : tensor(int32), tensor(int64)</tt> — Constrain position to integral tensor. It must be a scalar(tensor of empty shape).</p>
</dd>
<dt>Test vectors</dt>
<dd id="_b653717d-9683-f7bc-de5c-8a8cc458f8f5"><p id="_6860f003-1316-f69a-8aaa-cf7bbdb3b04d"><tt>test_sequence_insert_</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_565ce9a9-2cfb-9c44-b343-ebe6a25eeb0f"><p id="_1624de58-4f6c-ea46-3050-5f3538586f71">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_f08d7440-7f32-07a4-c865-2d2dd6e64d4a" anchor="op-ai-onnx-default-sequencelength" obligation="normative">
<title id="_dedf057d-eae0-cf79-9ea4-96ab6197890c">SequenceLength</title>
<p id="_c59cb5e1-cb11-0d14-7b6b-f8a5083b8caa">Produces a scalar(tensor of empty shape) containing the number of tensors in ‘input_sequence’.</p>

<dl id="_3b0243a8-a80b-5599-398f-b851d31b9030"><dt>Domain</dt>
<dd id="_460da278-6f09-532b-c7a4-02c763b0c2fb"><p id="_881d064f-cd8a-a054-7f96-df7ce7f85f16"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_395bc00b-332d-3b6a-267f-db65081d648a"><p id="_596f4d01-3a08-d5d2-cd0f-7d4ab1d29656">11</p>
</dd>
<dt>Inputs</dt>
<dd id="_68ab8b91-c85d-b1a6-7cfd-1353a07caaa9"><p id="_71bff6dd-14bf-fb67-f241-af8ea16c0011"><tt>input_sequence : S</tt> — Input sequence.</p>
</dd>
<dt>Outputs</dt>
<dd id="_c250a4b2-054b-c2dd-5100-9121edb6f127"><p id="_6ebb9cab-34ea-f972-39a9-76e220c4b0aa"><tt>length : I</tt> — Length of input sequence. It must be a scalar(tensor of empty shape).</p>
</dd>
<dt>Attributes</dt>
<dd id="_e622f988-9eaa-530f-5efa-c13b898da198"><p id="_48c22be9-ab51-ba63-6395-29f1aec7bcc9">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_efb21d59-d2ea-c785-eb38-765a17fe5b87"><p id="_5fc182ba-4955-6a61-7dba-c4723cffaa44"><tt>S : seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128))</tt> — Constrain to any tensor type.<br/> <tt>I : tensor(int64)</tt> — Constrain output to integral tensor. It must be a scalar(tensor of empty shape).</p>
</dd>
<dt>Test vectors</dt>
<dd id="_cddcf4d8-87e5-fe0f-ee31-a9a4a4e7275d"><p id="_da1e3513-d4a3-c2cb-e8e1-eee0349c3b20">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_6a545cee-98a2-c0ff-4705-b1b05f07deb2"><p id="_3e24d454-f36a-09f0-215f-8ee47d659dc0">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_8bb9bf31-0061-5353-135e-144d02d3fb68" anchor="op-ai-onnx-default-sequencemap" obligation="normative">
<title id="_3ea9fff3-331a-54e2-7c8b-966f85951fef">SequenceMap</title>
<p id="_63a89f8f-b07b-0d1a-e47b-bee2e36d3f0e">Applies a sub-graph to each sample in the input sequence(s).</p>

<p id="_1ded620f-a3d1-fcdd-c274-ca88e733e749">Inputs can be either tensors or sequences, with the exception of the first input which must be a sequence. The length of the first input sequence will determine the number of samples in the outputs. Any other sequence inputs should have the same number of samples. The number of inputs and outputs, should match the one of the subgraph.</p>

<p id="_505e95aa-6685-a291-0973-7297b0d3955c">For each i-th element in the output, a sample will be extracted from the input sequence(s) at the i-th position and the sub-graph will be applied to it. The outputs will contain the outputs of the sub-graph for each sample, in the same order as in the input.</p>

<p id="_521330b3-f9b0-470c-14e8-b421f4b477a5">This operator assumes that processing each sample is independent and could executed in parallel or in any order. Users cannot expect any specific ordering in which each subgraph is computed.</p>

<dl id="_2a63685d-3c6e-bd97-c83e-b1fdb6a3d2c5"><dt>Domain</dt>
<dd id="_91021aed-0444-cc21-7b42-b963348af510"><p id="_50a3e919-1307-78d1-d6ea-276a177edf9b"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_402370cb-1034-f1d2-2db0-a4c30c916389"><p id="_f2f38e87-53a1-0ae3-277f-76a7d98f04f3">17</p>
</dd>
<dt>Inputs (1 — unbounded)</dt>
<dd id="_6be566f2-f891-d29c-a647-ff206a2f27aa"><p id="_8ed59e2a-cfe5-cbe3-c5d9-84bbca2460cf"><tt>input_sequence : S</tt> — Input sequence.<br/> <tt>additional_inputs (variadic, heterogeneous) : V</tt> — Additional inputs to the graph</p>
</dd>
<dt>Outputs (1 — unbounded)</dt>
<dd id="_e7024a84-f400-5c71-54b2-5d46eecf33ab"><p id="_5cf6381f-bf66-b3da-fdf0-128d6a651883"><tt>out_sequence (variadic, heterogeneous) : S</tt> — Output sequence(s)</p>
</dd>
<dt>Attributes</dt>
<dd id="_8dd29547-cb64-8972-e3de-e3b691b6391b"><p id="_24a72ea0-e686-1013-c16e-a118bbf546db"><tt>body : graph (required)</tt> — The graph to be run for each sample in the sequence(s). It should have as many inputs and outputs as inputs and outputs to the SequenceMap function.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_25ecb08e-0a06-956c-9664-209cd6688c30"><p id="_87cdc89c-28af-afcb-5a70-051d959a5a3a"><tt>S : seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128))</tt> — Constrain input types to any sequence type.<br/> <tt>V : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128))</tt> — Constrain to any tensor or sequence type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_8ceb2a78-9bff-751a-19a1-16fad8de20ba"><p id="_833a0921-f265-eb9c-ad22-2c3b7ed54043"><tt>test_sequence_map_add_1_sequence_1_tensor</tt>, <tt>test_sequence_map_add_2_sequences</tt>, <tt>test_sequence_map_extract_shapes</tt>, <tt>test_sequence_map_identity_1_sequence</tt>, <tt>test_sequence_map_identity_1_sequence_1_tensor</tt>, <tt>test_sequence_map_identity_2_sequences</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_b50dd7b1-e409-84c0-0e05-f9f8987c016a"><p id="_8982350f-e4a2-ab90-1329-db6c8b329e94">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_24223b5a-76ee-a2e0-f77a-5cf0e0f59c1c" anchor="op-ai-onnx-default-shape" obligation="normative">
<title id="_5b038537-0354-e1ad-bb0a-e34301e92bb2">Shape</title>
<p id="_eda908c5-34d3-eeb4-3d7a-3aa64937093e">Takes a tensor as input and outputs an 1D int64 tensor containing the shape of the input tensor. Optional attributes start and end can be used to compute a slice of the input tensor’s shape. If start axis is omitted, the slice starts from axis 0. The end axis, if specified, is exclusive (and the returned value will not include the size of that axis). If the end axis is omitted, the axes upto the last one will be included. Negative axes indicate counting back from the last axis. Note that axes will be clamped to the range [0, r], where r is the rank of the input tensor if they are out-of-range (after adding r in the case of negative axis). Thus, specifying any end value &gt; r is equivalent to specifying an end value of r, and specifying any start value &lt; -r is equivalent to specifying a start value of 0. If start &gt; end, the result will be an empty shape.</p>

<p id="_24a13c7c-c385-d3ac-80c6-187ebdf606f3">Examples:</p>

<sourcecode id="_22b3c551-757d-2153-6eaf-ec0a696724a9" unnumbered="true"><body>Input tensor with shape: [2, 3, 4]
No attributes specified.
Output: [2, 3, 4]</body></sourcecode>


<sourcecode id="_eb44ad9d-6926-d2ad-2fd7-9dfe0182977c" unnumbered="true"><body>Input tensor with shape: [2, 3, 4]
start: -1
Output: [4]</body></sourcecode>


<sourcecode id="_1d60e2a7-5e3e-2d29-f2d0-29cf0c73173f" unnumbered="true"><body>Input tensor with shape: [2, 3, 4]
end: -1
Output: [2, 3]</body></sourcecode>


<sourcecode id="_0379dc19-3bf6-9f57-11e4-dd9de6cc43fe" unnumbered="true"><body>Input tensor with shape: [2, 3, 4]
start: 1
end: 2
Output: [3]</body></sourcecode>


<dl id="_c75ebfb0-b230-76e3-7a0e-959c788e3813"><dt>Domain</dt>
<dd id="_09385883-a74c-70b0-ab24-5e584de4a0ea"><p id="_9867216e-845e-a88d-3f93-6d994fd0d527"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_9da6f180-cfd8-8066-7f9d-f5904ad6f98d"><p id="_8c2dc0d6-fb70-e961-54b4-0717224e84b6">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_12ee300e-82a1-be17-4063-8ae94e2da4ff"><p id="_3d8a902c-ee6a-a100-4c97-b5958bf44350">1, 13, 15, 19, 21, 23, 24</p>
</dd>
<dt>Inputs</dt>
<dd id="_86013b0d-71fc-a6ae-0673-10f2b8870bdf"><p id="_d65f5533-3bc7-24c9-d785-fba68fc2f9ba"><tt>data (non-differentiable) : T</tt> — An input tensor.</p>
</dd>
<dt>Outputs</dt>
<dd id="_58fbc94d-a767-34de-e7dd-6d2f5d826ece"><p id="_2e10d4ec-fe2e-2fcb-5799-2106d5745f5f"><tt>shape (non-differentiable) : T1</tt> — Shape of the input tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_d120642d-c1c5-f622-a190-1eed88fa18df"><p id="_c3e77d22-21ea-b437-6d8b-c440add44b55"><tt>end : int</tt> — (Optional) Ending axis for slicing the shape. Negative value means counting dimensions from the back. If omitted, sizes of all axes upto (including) the last one will be included.<br/> <tt>start : int (default is 0)</tt> — (Optional) Starting axis for slicing the shape. Default value is 0.Negative value means counting dimensions from the back.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_2c9cfd3c-bf65-197e-84c6-ed0c1e5cdc82"><p id="_85b1b63d-97f7-3e74-1e97-82baf12f0247"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2)</tt> — Input tensor can be of arbitrary type.<br/> <tt>T1 : tensor(int64)</tt> — Constrain output to int64 tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_7336b741-1344-0234-05d1-92e5409f2867"><p id="_2a854d5d-1585-dcc1-d212-e046e2bc1769">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_d2689d65-c2e1-d66b-89f1-9153e931e0b2"><p id="_5373ae86-1e5b-901b-75e7-f1960fa296f9">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_4be35f2f-29de-a256-c180-8b0e176df8ce" anchor="op-ai-onnx-default-shrink" obligation="normative">
<title id="_d7721946-4b21-e580-2eda-6dd46be884b6">Shrink</title>
<p id="_d0fd5b1c-61d1-4b66-4f9c-eba7a384ca3e">Shrink takes one input data (<tt>Tensor&lt;numeric&gt;</tt>) and produces one Tensor output, having same datatype and shape with input. It has two attributes, lambd and bias. The formula of this operator is: If x &lt; -lambd, y = x + bias; If x &gt; lambd, y = x — bias; Otherwise, y = 0.</p>

<dl id="_3d4a4c7f-68e7-f913-5717-11f902f1c584"><dt>Domain</dt>
<dd id="_e5b1082c-7176-84da-04c4-4f05cdc79d74"><p id="_19151495-4792-3888-c6f3-dab3da4a3d3e"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_40f319d6-f840-e5f3-9ecb-040098a868b4"><p id="_9222885e-b7b2-b204-2d7b-04a045840ae0">9</p>
</dd>
<dt>Inputs</dt>
<dd id="_b1df0006-27bd-365c-ec55-12a55d0f0b39"><p id="_f39da370-8e5f-be25-8cd5-db997601df5d"><tt>input (differentiable) : T</tt> — The input data as Tensor.</p>
</dd>
<dt>Outputs</dt>
<dd id="_456f48cb-92c8-79ce-9260-e050536a19fc"><p id="_cfae558d-83c7-47dc-ad19-394c834cc15d"><tt>output (differentiable) : T</tt> — The output.</p>
</dd>
<dt>Attributes</dt>
<dd id="_49bef56f-3fe2-ae28-90dd-b515305cd4a7"><p id="_40549134-f16a-f6b7-baa4-18460a8b1a5c"><tt>bias : float (default is 0.0)</tt> — The bias value added to output. Default is 0.<br/> <tt>lambd : float (default is 0.5)</tt> — The lambd value for the Shrink formulation. Default is 0.5.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_b7144766-dc7e-e7b9-7cdc-99444106c89d"><p id="_c155f988-0eab-1d66-c415-697047e2a315"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input to only numeric types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_36ed18ae-e3a9-3f83-4c10-47b8d3c0457e"><p id="_b0795707-2858-cc58-9003-19be60231ea3"><tt>test_shrink_hard</tt>, <tt>test_shrink_soft</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_ffe81307-959a-973d-5d2e-995cd0f8a584"><p id="_37e690da-1ee7-8a0a-10a5-cb6c1ff0333d">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_f320c569-80e1-61a9-d7c5-dc0250744ce2" anchor="op-ai-onnx-default-sigmoid" obligation="normative">
<title id="_644a8a42-5f22-9724-d0a2-d923c6328311">Sigmoid</title>
<p id="_0b3b2454-f435-d57b-0f16-e0c1d408fde4">Sigmoid takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the sigmoid function, y = 1 / (1 + exp(-x)), is applied to the tensor elementwise.</p>

<dl id="_bfe2c07a-bf8b-15ce-8af1-936efef65a08"><dt>Domain</dt>
<dd id="_4ad98f74-34e8-80f9-ccc7-419d3d160056"><p id="_f1865807-cae8-6dd7-fb1a-d38fba694bf8"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_9ab5bdb4-1e63-d681-3d92-8102da8c9483"><p id="_78962dcb-1f1d-d955-2e3c-c822918ad9e2">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_5d5b52a5-6952-cf3e-4c8d-24aa608e16c5"><p id="_d8496a77-211c-7fa4-b379-dadedefd2a3b">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_d5b18e18-1a1f-85bf-ecc2-038c098635b5"><p id="_ab7ea4c6-d7b1-12ed-4117-f3f3dd80cda4"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_326c50d2-7290-3ccf-fac2-a5e57e957df8"><p id="_575bb85a-dadb-3433-91c5-153da4542de8"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_6960aae0-1ca9-fe99-43e7-1883f51ceebe"><p id="_96a58531-ef2b-9737-7fa3-0fc74f88e7d4">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_cae7b2e9-6abb-1965-0c14-4a4c40393870"><p id="_92c60556-6ec9-0c4b-6027-cbcfe1b5981e"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_3d44cf88-0f51-c2fc-24c7-2e18bf8e00cf"><p id="_a10dc0a8-f4c1-d7bd-8646-b44d8dfb6a22"><tt>test_sigmoid_example</tt>, <tt>test_sigmoid</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_afcfa67f-1a80-a68d-f24b-5c444f490922"><p id="_dae3d6c4-e2d8-68d3-0480-73ad82ff6102">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_1172af47-b1be-12f5-db82-ec4107a10a42" anchor="op-ai-onnx-default-sign" obligation="normative">
<title id="_ebac292a-eae6-6ad7-4a42-6a8e0145e3ba">Sign</title>
<p id="_b950b815-5441-fb7f-b128-a5c5725a06ca">Calculate the sign of the given input tensor element-wise. If input &gt; 0, output 1. if input &lt; 0, output -1. if input == 0, output 0.</p>

<dl id="_624bc65e-d54c-6497-4eed-e7ef4d421417"><dt>Domain</dt>
<dd id="_f9c7d3dc-58b7-7dfc-8376-4929078c43c0"><p id="_e1342e6e-904c-8768-be7c-3cbbe2481172"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_5d9d00bd-9f5f-d2b1-341a-98cfe157acab"><p id="_cc294ffc-44b9-4d40-b010-c39ce6a5c6b0">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_e07c3d05-7d2d-45ec-7e40-9c9a75cf672b"><p id="_40a3d86e-6725-56f0-2c16-dc265773eec6">9</p>
</dd>
<dt>Inputs</dt>
<dd id="_0b98d80f-816c-de63-f277-8414eafabf2a"><p id="_ac482009-1ef0-7d81-7e85-9fb068b8b9d2"><tt>input (non-differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_5f3b913c-f3bb-0c91-bca3-39936927be96"><p id="_95a78d3a-fdc3-8fe1-9da3-a711e4fcf075"><tt>output (non-differentiable) : T</tt> — The sign of the input tensor computed element-wise. It has the same shape and type of the input.</p>
</dd>
<dt>Attributes</dt>
<dd id="_29fd2185-d791-7ce3-910a-4967198992f4"><p id="_f00cb728-4a31-6154-d8a3-083a017e87ba">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_56d4a615-4ad4-2995-ded7-b1feb44202ea"><p id="_8a0669ba-1eef-7791-2383-ab9d66a2ca02"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to all numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_3eece9e5-0758-d69c-1419-51f072780b91"><p id="_6e832374-0d37-0674-edf3-abca146df81e"><tt>test_sign</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_9e9623ff-4bcd-57ca-b15a-5c9e602d0eba"><p id="_be3cd469-c04b-ffde-93b7-83b89f265aea">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_3e629536-4263-8886-e9dc-c15bac7976b3" anchor="op-ai-onnx-default-sin" obligation="normative">
<title id="_566314ee-5106-5098-90ea-b257261bd97c">Sin</title>
<p id="_d6c6e460-2207-def0-47e4-df2cc72b44af">Calculates the sine of the given input tensor, element-wise.</p>

<dl id="_d115441c-4222-f57f-7488-ecf617786848"><dt>Domain</dt>
<dd id="_441301a7-a6ef-c4e6-8895-64c3511e8f48"><p id="_85fdb3ff-41e2-0869-200d-07a755e6eaf7"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_627c83a6-7536-d71b-afcc-6c60068648c6"><p id="_b3b5c914-03e5-4653-753d-a26b34625345">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_98014b19-6eab-4f2b-fa55-390d40f682c6"><p id="_c0ce9684-5015-5c11-09ec-8a998877b98f">7</p>
</dd>
<dt>Inputs</dt>
<dd id="_947d8104-6993-151c-a224-27be6ba531f1"><p id="_126b91b4-a4d6-7081-6e1d-888efe0e12c5"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_15b69aa3-fcb1-81a0-d92e-2b1866845a86"><p id="_c60bbfbb-c877-0437-fc5a-bbaed2c34a17"><tt>output (differentiable) : T</tt> — The sine of the input tensor computed element-wise</p>
</dd>
<dt>Attributes</dt>
<dd id="_68188fce-fdde-6c3b-5014-0265904d05c7"><p id="_c2646cc4-9147-953c-e68c-605ee26989cb">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_b103b445-dcb0-7647-f873-9a1cba2a3044"><p id="_0b8acbb3-5a2f-0d9f-b313-02eaef62d253"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_2411a04a-6122-9291-efb0-e821da03aec1"><p id="_cc841164-d92d-c43e-c4d8-ce69b594621a"><tt>test_sin_example</tt>, <tt>test_sin</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_aad38120-658b-724c-342f-a71c515f549a"><p id="_852cac5d-f157-5ffe-ec57-923af5aac3a0">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_5003471d-9ff4-2084-6e97-687e3a11c918" anchor="op-ai-onnx-default-sinh" obligation="normative">
<title id="_fc10f54d-f2ab-f424-3369-c7071ab81151">Sinh</title>
<p id="_c7e58262-080e-1002-258d-818bad9fbfcf">Calculates the hyperbolic sine of the given input tensor element-wise.</p>

<dl id="_202b99e4-5ff4-4f1e-56dc-dcacfe513154"><dt>Domain</dt>
<dd id="_7827fda5-3772-fcb3-429f-e7f95006dbb8"><p id="_a8a395a8-d12e-3c09-644f-c0104f385c6a"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_1b934126-92c6-6ba0-d9f8-8555a482981c"><p id="_11c5a998-02db-a711-eb51-ef6661d36f54">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_44d6afb7-3c0f-7f95-548e-c26c25272146"><p id="_e4ebc01a-35c6-314b-961b-005bc4c427e3">9</p>
</dd>
<dt>Inputs</dt>
<dd id="_87b9f180-c7f1-68c0-6fa8-5d2f744c16d3"><p id="_59880045-8e4d-daa4-d349-1509385fe1a6"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_cd45f997-9e12-78c6-671e-12ee12fcd22d"><p id="_63d817ac-6b20-3d49-ffbb-88e11f24f90d"><tt>output (differentiable) : T</tt> — The hyperbolic sine values of the input tensor computed element-wise</p>
</dd>
<dt>Attributes</dt>
<dd id="_3d73eceb-ded6-c96a-7632-53496de6b0f6"><p id="_f36ba4ce-6391-c786-2196-cd94fa4dc229">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_ab6cfef1-09c0-ec81-b380-d7da7ffe8f02"><p id="_8e8e0f0c-b6c8-2884-2c3b-d6bd85dafecc"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_da8f1604-f41b-57af-dacf-6efbbe8f5e2a"><p id="_da884dd7-6ce8-2c60-3929-feae0b2792af"><tt>test_sinh_example</tt>, <tt>test_sinh</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_1adba229-7cb0-6c24-33fc-9db3558fcfd1"><p id="_24c49900-31a8-77e7-284f-4ba77cf9da7f">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_ebbbc150-f189-fcfd-d825-cd48fb11f6e7" anchor="op-ai-onnx-default-size" obligation="normative">
<title id="_a4b3b5ca-83d4-74fb-649c-afc581579021">Size</title>
<p id="_12c12c32-d13d-2fe5-b5f1-5b55c59a5acd">Takes a tensor as input and outputs a int64 scalar that equals to the total number of elements of the input tensor.</p>

<dl id="_8a6e5676-d1af-54b1-9d55-c9cc5d5e5973"><dt>Domain</dt>
<dd id="_3ac502ad-4ab5-fbd2-2d87-babac28d4432"><p id="_24f44dd2-5d26-4464-32b9-8c3a63f0b9c1"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_b61327b6-0129-df3e-f4e3-85ba1478a37c"><p id="_6268ea89-cc7c-587d-88a7-49c771d9b1ae">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_30e51322-47cf-518b-828c-b647be70c5a1"><p id="_1104c617-4084-4457-4cc3-c4efe70e95e8">1, 13, 19, 21, 23, 24</p>
</dd>
<dt>Inputs</dt>
<dd id="_c1d67b05-31c4-ff36-32ee-223b3e09fa9f"><p id="_d4857b16-1bed-a681-a7fd-96c6a45eef82"><tt>data (non-differentiable) : T</tt> — An input tensor.</p>
</dd>
<dt>Outputs</dt>
<dd id="_0bcb1b63-9793-2a09-d8a7-1fe53ba720cb"><p id="_0bbda9ee-02ed-ac38-ca54-18e7d7ba1807"><tt>size (non-differentiable) : T1</tt> — Total number of elements of the input tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_e383704e-8c22-37ab-33a9-f1cf6c4c4c47"><p id="_a54fc154-163b-ef3d-8ffc-0933b5d59f6a">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_6d688d0b-e7bd-7335-6d32-7151723dc55f"><p id="_2be31763-71c2-8315-82db-840449a02425"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2)</tt> — Input tensor can be of arbitrary type.<br/> <tt>T1 : tensor(int64)</tt> — Constrain output to int64 tensor, which should be a scalar though.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_831f04f2-0313-199f-c48b-b39bb3b06329"><p id="_a04c9f64-1ad8-7219-d9a1-548fe5cc9d6e"><tt>test_size_example</tt>, <tt>test_size</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_31cbad39-8279-63b7-7d9e-968d4378c0cf"><p id="_824f69f6-5df6-9cb4-84b5-86f485bc388c">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_72c08d35-2460-6406-97e2-debe3480b5dd" anchor="op-ai-onnx-default-slice" obligation="normative">
<title id="_e4985c34-c251-412f-cf84-e7097e154801">Slice</title>
<p id="_20ae5a64-4478-b66f-f21f-bf8617b12454">Produces a slice of the input tensor along multiple axes. Similar to numpy: <link target="https://numpy.org/doc/stable/user/basics.indexing.html?highlight=slice#slicing-and-striding"/></p>

<p id="_ac093abc-ea22-ba54-3c31-d49f38e3cbb0">Slice uses the <tt>starts</tt>, <tt>ends</tt>, <tt>axes</tt> and <tt>steps</tt> inputs to select a sub-tensor of its input  <tt>data</tt> tensor.</p>

<p id="_31cac4d0-b5fd-9467-7881-1877fc7fb977">An effective <tt>starts[i]</tt>, <tt>ends[i]</tt>, and <tt>steps[i]</tt> must be computed for each <tt>i</tt> in  <tt>[0, ... r-1]</tt> where <tt>r = rank(input)</tt> as follows:</p>

<p id="_06f3fee3-c331-f6a6-fdb2-5f209664e9c1">If <tt>axes</tt> are omitted, they are set to <tt>[0, ..., r-1]</tt>. If  <tt>steps</tt> are omitted, they are set to <tt>[1, ..., 1]</tt> of length <tt>len(starts)</tt></p>

<p id="_ee1fbc86-4faa-cd68-0af4-9fd4d7774747">The effective values are initialized as <tt>starts[i] = 0</tt>, <tt>ends[i] = dims[i]</tt> where <tt>dims</tt> are the dimensions of <tt>input</tt> and <tt>steps[i] = 1</tt>.</p>

<p id="_c7f92cb8-dfab-2ebd-643a-5180b8a99e80">All negative elements of <tt>axes</tt> are made non-negative by adding <tt>r</tt> to them, where <tt>r =rank(input)</tt>.</p>

<p id="_8543958f-f94b-6ee3-0f46-480c0e90758b">All negative values in <tt>starts[i]</tt> and <tt>ends[i]</tt> have <tt>dims[axes[i]]</tt> added to them, where  <tt>dims</tt> are the dimensions of <tt>input</tt>. Then <tt>starts[axes[i]]</tt> is clamped to range  <tt>[0, dims[axes[i]]]</tt> for positive stepping, or to range <tt>[0, dims[axes[i]]-1]</tt> for negative stepping.</p>

<p id="_bef9263e-238e-f235-f774-8cd8aeebbdc0">The clamping for the adjusted <tt>ends[i]</tt> depends on the sign of <tt>steps[i]</tt> and must accommodate copying 0 through  <tt>dims[axes[i]]</tt> elements, so for positive stepping <tt>ends[axes[i]]</tt> is clamped to <tt>[0, dims[axes[i]]]</tt>, while for negative stepping it is clamped to  <tt>[-1, dims[axes[i]]-1]</tt>.</p>

<p id="_faed5824-9eb6-c616-db95-ac75b5dedbd0">Finally, <tt>steps[axes[i]] = steps[i]</tt>.</p>

<p id="_58f21663-dbe9-fad0-12e7-beccba89ae0f">For slicing to the end of a dimension with unknown size, it is recommended to pass in  <tt>INT_MAX</tt> when slicing forward and ‘INT_MIN’ when slicing backward.</p>

<p id="_85cf9e9a-e7d7-1438-6598-0a4f51c91f72">Example 1:</p>

<sourcecode id="_6a7cab06-c965-34b3-7951-6cdba8b7097d" unnumbered="true"><body>data = [
    [1, 2, 3, 4],
    [5, 6, 7, 8],
]
axes = [0, 1]
starts = [1, 0]
ends = [2, 3]
steps = [1, 2]
result = [
    [5, 7],
]</body></sourcecode>


<p id="_20ae6f02-77ab-273b-e47d-bc14b3d2a44b">Example 2:</p>

<sourcecode id="_a89ce053-2fbd-fad2-5936-f7ab871026d9" unnumbered="true"><body>data = [
    [1, 2, 3, 4],
    [5, 6, 7, 8],
]
starts = [0, 1]
ends = [-1, 1000]
result = [
    [2, 3, 4],
]</body></sourcecode>


<dl id="_60535ceb-9e33-00b1-c9aa-1a652104411b"><dt>Domain</dt>
<dd id="_94483e00-c083-4fe5-b1cc-d8709bc0e076"><p id="_ac24f8dc-2e2f-a8ec-4ded-bc542f4f9b2f"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_648ad613-317a-0639-a8f2-bfaf2116257f"><p id="_151bdf42-27fc-0d4d-d4b0-fc4e2a4ef638">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_8674cfc4-386f-78db-d9ff-8bc80211197c"><p id="_65fe8ef7-3946-4f50-6c6b-a832e86dc241">1, 10, 11</p>
</dd>
<dt>Inputs (3 — 5)</dt>
<dd id="_1d718b59-3cdc-9099-2c09-d903883d288b"><p id="_6a70fa70-6bac-b545-5948-c9ba548f1733"><tt>data (differentiable) : T</tt> — Tensor of data to extract slices from.<br/> <tt>starts (non-differentiable) : Tind</tt> — 1-D tensor of starting indices of corresponding axis in <tt>axes</tt><br/> <tt>ends (non-differentiable) : Tind</tt> — 1-D tensor of ending indices (exclusive) of corresponding axis in <tt>axes</tt><br/> <tt>axes (optional, non-differentiable) : Tind</tt> — 1-D tensor of axes that <tt>starts</tt> and <tt>ends</tt> apply to. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(data). Behavior is undefined if an axis is repeated.<br/> <tt>steps (optional, non-differentiable) : Tind</tt> — 1-D tensor of slice step of corresponding axis in <tt>axes</tt>. Negative value means slicing backward. ‘steps’ cannot be 0. Defaults to 1s.</p>
</dd>
<dt>Outputs</dt>
<dd id="_bfd4fe14-102e-36b0-1dc6-05032608a991"><p id="_2c97ab9b-bed0-460f-b906-63f66b42b6b2"><tt>output (differentiable) : T</tt> — Sliced data tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_3d78baa3-5813-f556-50a5-0b6a2951dfc5"><p id="_45727ab5-3ad6-2d07-af9f-5a935f727854">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_0cf73109-974d-9c56-7161-f190be3e71df"><p id="_2ce54fb8-2c88-be80-22be-e2e4bc0a4c54"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input and output types to all tensor types.<br/> <tt>Tind : tensor(int32), tensor(int64)</tt> — Constrain indices to integer types</p>
</dd>
<dt>Test vectors</dt>
<dd id="_23135fd7-c879-7a0c-a230-134bbf08c1dd"><p id="_07579b73-6c1c-c42d-ad2a-9f860065b548"><tt>test_slice</tt>, <tt>test_slice_default_axes</tt>, <tt>test_slice_default_steps</tt>, <tt>test_slice_end_out_of_bounds</tt>, <tt>test_slice_neg</tt>, <tt>test_slice_neg_steps</tt>, <tt>test_slice_negative_axes</tt>, <tt>test_slice_start_out_of_bounds</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_33693b6d-5724-dfb6-ff39-f395cac0ca5d"><p id="_bfa2cec6-d3d2-8adc-26d3-092597c04c25">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_a48252e7-195b-16aa-9ce4-9b4b48cfa41d" anchor="op-ai-onnx-default-softmax" obligation="normative">
<title id="_607e3e6a-9924-fb32-2f63-ab0c0ec7e45c">Softmax</title>
<p id="_793e83e5-725b-eddd-1111-c8f268ff0ef5">The operator computes the normalized exponential values for the given input:</p>

<p id="_d2b52a2d-ca58-9f06-ba74-7093cc3ed7dd">Softmax(input, axis) = Exp(input) / ReduceSum(Exp(input), axis=axis, keepdims=1)</p>

<p id="_7ba650ba-543f-1ad1-f4cf-629782c61e36">The “axis” attribute indicates the dimension along which Softmax will be performed. The output tensor has the same shape and contains the Softmax values of the corresponding input.</p>

<dl id="_8fdd42d0-0645-4600-d9b2-671276087aaa"><dt>Domain</dt>
<dd id="_1c5c4288-30f9-6013-2e20-9bb77eb6a216"><p id="_a7efe69e-c7cd-61e2-f907-135cca40d0b3"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_022fa16d-836f-dd1a-2d5d-69385a4a961c"><p id="_541b0aff-582f-f76f-0b00-483d8e57f996">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_78df7e95-0e0f-f1a9-2faa-cc442d7566ce"><p id="_fbafb1e0-76a7-a8dc-7ef7-98da754b7ed4">1, 11</p>
</dd>
<dt>Inputs</dt>
<dd id="_63545697-f386-2dae-d436-75aa67838732"><p id="_2f34bdd3-9349-b8b4-ff9f-9c0c1c73c7ac"><tt>input (differentiable) : T</tt> — The input tensor of rank &gt;= axis.</p>
</dd>
<dt>Outputs</dt>
<dd id="_7b29c6dc-cba8-12e2-a081-0531c139afac"><p id="_8adea597-3815-2620-4418-9492eeeafa6f"><tt>output (differentiable) : T</tt> — The output values with the same shape as the input tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_8aea95cb-fb8f-e68c-6a59-49a64f738b2e"><p id="_b706b424-b1d0-f21f-c445-6ac86fd014b6"><tt>axis : int (default is -1)</tt> — Describes the dimension Softmax will be performed on. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(input).</p>
</dd>
<dt>Type constraints</dt>
<dd id="_69d5fe13-0794-23a8-0c79-4d9b484ae2c6"><p id="_6057e9fa-6349-2638-2544-7fb58ebd0a9c"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_23f00e01-bdaf-271e-32c6-deaccad89fe2"><p id="_16db745b-a714-3827-da80-90fcbf5b382e"><tt>test_softmax_example</tt>, <tt>test_softmax_large_number</tt>, <tt>test_softmax_axis_0</tt>, <tt>test_softmax_axis_1</tt>, <tt>test_softmax_axis_2</tt>, <tt>test_softmax_negative_axis</tt>, <tt>test_softmax_default_axis</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_6d9b4d76-2627-1640-597d-c0bf90cbe15e"><p id="_04a3550c-f311-b7ea-60ad-81d27385d427">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_d8c355a8-d229-e5dd-0ade-f9d5774257c4" anchor="op-ai-onnx-default-softmaxcrossentropyloss" obligation="normative">
<title id="_8e3677ef-7f23-de22-c5f4-f7bd7868b833">SoftmaxCrossEntropyLoss</title>
<p id="_90391b31-3e49-9ee2-3acb-fa709d5175c3">Loss function that measures the softmax cross entropy between ‘scores’ and ‘labels’. This operator first computes a loss tensor whose shape is identical to the labels input. If the input is 2-D with shape (N, C), the loss tensor may be a N-element vector L = (l_1, l_2, …​, l_N). If the input is N-D tensor with shape (N, C, D1, D2, …​, Dk), the loss tensor L may have (N, D1, D2, …​, Dk) as its shape and L[i,][j_1][j_2]…​[j_k] denotes a scalar element in L. After L is available, this operator can optionally do a reduction operator.</p>

<ul id="_daaf9f38-eeb5-23fc-7f4e-59ceca70ebaa"><li><p id="_e02e6eb3-a0e6-81d5-5817-5b32576ff1c8">shape(scores): (N, C) where C is the number of classes, or (N, C, D1, D2,…​, Dk), with K &gt;= 1 in case of K-dimensional loss.</p>
</li>
<li><p id="_e96d1967-aada-2db9-e4c7-d3e9994662b7">shape(labels): (N) where each value is 0 &lt;= labels[i] &lt;= C-1, or (N, D1, D2,…​, Dk), with K &gt;= 1 in case of K-dimensional loss.</p>
</li>
</ul>

<p id="_36d5b4f6-fa2e-aeda-3108-e8283a7e6925">The loss for one sample, l_i, can calculated as follows:</p>

<sourcecode id="_0a386e1c-fc3f-bae7-a2ae-74b32dd60a78" unnumbered="true"><body>l[i][d1][d2]...[dk] = -y[i][c][d1][d2]..[dk], where i is the index of classes.</body></sourcecode>


<p id="_0eb1f533-a1ba-cb00-1aca-0d9ae29bc0d6">or</p>

<sourcecode id="_350d78e1-cd50-da18-f650-924c8c056c9d" unnumbered="true"><body>l[i][d1][d2]...[dk] = -y[i][c][d1][d2]..[dk] * weights[c], if 'weights' is provided.</body></sourcecode>


<p id="_8d5d2a28-712a-744e-e222-641695ac233b">loss is zero for the case when label-value equals ignore_index.</p>

<sourcecode id="_c86a41d1-8576-e77b-215f-b84fd0b3d041" unnumbered="true"><body>l[i][d1][d2]...[dk]  = 0, when labels[n][d1][d2]...[dk] = ignore_index</body></sourcecode>


<p id="_15281490-48c6-3895-1f29-636ade6d3b79">where:</p>

<sourcecode id="_1cea9f58-7064-f942-46ef-e889d332eef9" unnumbered="true"><body>p = Softmax(scores)
y = Log(p)
c = labels[i][d1][d2]...[dk]</body></sourcecode>


<p id="_b343c8d0-5631-9942-24d9-7c3c2af1d4e9">Finally, L is optionally reduced:</p>

<ul id="_f55438f0-b333-f18c-ff4a-2b67ba5f27fc"><li><p id="_3bb9551b-03e8-210b-6854-8f128021870d">If reduction = ‘none’, the output is L with shape (N, D1, D2, …​, Dk).</p>
</li>
<li><p id="_bb871d2f-1a74-7a1b-33ad-a3e05c95ea37">If reduction = ‘sum’, the output is scalar: Sum(L).</p>
</li>
<li><p id="_e416e036-5f94-9066-4730-d2649a5983b0">If reduction = ‘mean’, the output is scalar: ReduceMean(L), or if weight is provided: <tt>ReduceSum(L) / ReduceSum(W)</tt>, where tensor W is of shape  <tt>(N, D1, D2, ..., Dk)</tt> and <tt>W[n][d1][d2]...[dk] = weights[labels[i][d1][d2]...[dk]]</tt>.</p>
<dl id="_3a0c4b64-d1c7-49d2-1605-e20b565139be"><dt>Domain</dt>
<dd id="_55becd19-7ab4-7113-169b-dd3e6d7dda39"><p id="_78e49510-830b-ef6d-03ac-893c2988dc32"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_6ed720e1-23a0-743f-79bd-ed4296d1d3d7"><p id="_23183223-ee8a-eef4-6b7c-1c2780e9f5a2">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_5dc9062c-2b82-8fe0-dbb7-c52702221a91"><p id="_0c348ca5-d4f5-6906-57dc-b2096d87b188">12</p>
</dd>
<dt>Inputs (2 — 3)</dt>
<dd id="_40b8f1c8-1c95-989d-4994-9b5893f4c2aa"><p id="_36d6d558-7799-73af-d4fc-3eb0ae06208a"><tt>scores (differentiable) : T</tt> — The predicted outputs with shape [batch_size, class_size], or [batch_size, class_size, D1, D2 , …​, Dk], where K is the number of dimensions.<br/> <tt>labels (non-differentiable) : Tind</tt> — The ground truth output tensor, with shape [batch_size], or [batch_size, D1, D2, …​, Dk], where K is the number of dimensions. Labels element value shall be in range of [0, C). If ignore_index is specified, it may have a value outside [0, C) and the label values should either be in the range [0, C) or have the value ignore_index.<br/> <tt>weights (optional, non-differentiable) : T</tt> — A manual rescaling weight given to each class. If given, it has to be a 1D Tensor assigning weight to each of the classes. Otherwise, it is treated as if having all ones.</p>
</dd>
<dt>Outputs (1 — 2)</dt>
<dd id="_2b1ee9f0-e0e0-08ea-c432-7142700b5516"><p id="_d21b78f0-795a-76af-58ad-db9fb74953ae"><tt>output (differentiable) : T</tt> — Weighted loss float Tensor. If reduction is ‘none’, this has the shape of [batch_size], or [batch_size, D1, D2, …​, Dk] in case of K-dimensional loss. Otherwise, it is a scalar.<br/> <tt>log_prob (optional, differentiable) : T</tt> — Log probability tensor. If the output of softmax is prob, its value is log(prob).</p>
</dd>
<dt>Attributes</dt>
<dd id="_39d41e1c-7286-d55d-9de1-2f8e1e23cf70"><p id="_a78cbacf-b66a-d96d-f79c-84a84bbec5a4"><tt>ignore_index : int</tt> — Specifies a target value that is ignored and does not contribute to the input gradient. It’s an optional value.<br/> <tt>reduction : string (default is mean)</tt> — Type of reduction to apply to loss: none, sum, mean(default). ‘none’: no reduction will be applied, ‘sum’: the output will be summed. ‘mean’: the sum of the output will be divided by the number of elements in the output.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_f9d35a83-a5d9-1fa1-35a3-c51591571f0f"><p id="_a4312bb9-9b21-2654-b5be-bfc5bde65f92"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.<br/> <tt>Tind : tensor(int32), tensor(int64)</tt> — Constrain target to integer types</p>
</dd>
<dt>Test vectors</dt>
<dd id="_22333c3d-8aa7-49d1-0073-153859e8377c"><p id="_ab0ded6b-26c2-046d-4001-952cbc313165"><tt>test_sce_NCd1_mean_weight_negative_ii</tt>, <tt>test_sce_NCd1_mean_weight_negative_ii_log_prob</tt>, <tt>test_sce_NCd1d2d3_none_no_weight_negative_ii</tt>, <tt>test_sce_NCd1d2d3_none_no_weight_negative_ii_log_prob</tt>, <tt>test_sce_NCd1d2d3_sum_weight_high_ii</tt>, <tt>test_sce_NCd1d2d3_sum_weight_high_ii_log_prob</tt>, <tt>test_sce_NCd1d2d3d4d5_mean_weight</tt>, <tt>test_sce_NCd1d2d3d4d5_mean_weight_log_prob</tt>, <tt>test_sce_NCd1d2d3d4d5_none_no_weight</tt>, <tt>test_sce_NCd1d2d3d4d5_none_no_weight_log_prob</tt>, <tt>test_sce_mean</tt>, <tt>test_sce_mean_3d</tt>, <tt>test_sce_mean_3d_log_prob</tt>, <tt>test_sce_mean_log_prob</tt>, <tt>test_sce_mean_no_weight_ii</tt>, <tt>test_sce_mean_no_weight_ii_3d</tt>, <tt>test_sce_mean_no_weight_ii_3d_log_prob</tt>, <tt>test_sce_mean_no_weight_ii_4d</tt>, <tt>test_sce_mean_no_weight_ii_4d_log_prob</tt>, <tt>test_sce_mean_no_weight_ii_log_prob</tt>, <tt>test_sce_mean_weight</tt>, <tt>test_sce_mean_weight_ii</tt>, <tt>test_sce_mean_weight_ii_3d</tt>, <tt>test_sce_mean_weight_ii_3d_log_prob</tt>, <tt>test_sce_mean_weight_ii_4d</tt>, <tt>test_sce_mean_weight_ii_4d_log_prob</tt>, <tt>test_sce_mean_weight_ii_log_prob</tt>, <tt>test_sce_mean_weight_log_prob</tt>, <tt>test_sce_none</tt>, <tt>test_sce_none_log_prob</tt>, <tt>test_sce_none_weights</tt>, <tt>test_sce_none_weights_log_prob</tt>, <tt>test_sce_sum</tt>, <tt>test_sce_sum_log_prob</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_5cd649ab-6aa7-5b0e-57f2-3e8097b417ff"><p id="_a4e5bf1c-5062-6f1a-573f-fad256073440">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</li>
</ul>
</clause>

<clause id="_2d7eeed6-2c24-9958-6689-2c5dcba28c9f" anchor="op-ai-onnx-default-softplus" obligation="normative">
<title id="_ba187d99-23b6-c7e9-6b1d-5c2833b40b8d">Softplus</title>
<p id="_6569d43f-9519-8340-b9db-014efe77bafb">Softplus takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the softplus function, y = ln(exp(x) + 1), is applied to the tensor elementwise.</p>

<dl id="_c242c22d-5511-2d19-b3f2-5cbdc1b68e70"><dt>Domain</dt>
<dd id="_270fffaf-7452-0126-e9f9-23e4eab16885"><p id="_b6c39934-8632-8784-d526-6340ac93e4d6"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_3726399d-a81d-bf4d-7ab0-23dddc692444"><p id="_2c1103fd-00ea-02f1-7699-6ea3dfd08fe1">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_115898c6-c13c-9256-696c-d746cd75fe3f"><p id="_6e66ca12-2e10-cf45-2360-087316bf8e6e">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_cb5ce2f0-6092-6ada-bd91-0494d2478a6a"><p id="_3b7b8210-f106-325e-0962-c8ca585f20a1"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_00952b29-51d0-e669-bbee-189c384bbb2d"><p id="_1cb98666-2aa4-2468-7250-c0cd5311a71a"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_7c8325f2-003b-689c-91bb-71e5dddf1b2e"><p id="_098be0c6-28a2-e8a0-9cd7-babb9868a603">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_4946a670-4766-52e2-6454-81348fcc4f76"><p id="_a7dec5a5-c54f-eef0-e5f5-64231ffa6737"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_dd2457cc-ca0c-f9ac-6d0e-c0f5b31fe69a"><p id="_8a89fc7b-0c96-d3db-d15e-72b10163e066"><tt>test_softplus_example</tt>, <tt>test_softplus</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_64828b46-8183-91bd-c6c3-ed6e044c13e2"><p id="_cd48d9d6-ef1e-8332-2cc3-1d4b8e1586a4">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_1872c64f-22b5-3a9a-652d-dbc71bda5aed" anchor="op-ai-onnx-default-softsign" obligation="normative">
<title id="_b240be56-8363-373a-abd3-036505934251">Softsign</title>
<table id="_7e50cb16-2b45-f736-46e0-2913257b7661">
<name id="_9bbda8b2-0a4b-67e4-d5cd-96d06b1e974b">Table from the upstream description of <tt>Softsign</tt></name>
<tbody><tr id="_ebce337b-f087-308c-b815-e1eac220d006"><td id="_c2f538c0-799c-2b17-8597-d8d230311b8b" valign="top" align="left">Calculates the softsign (x/(1+</td>
<td id="_998407a2-e762-faec-a75f-7db066711c18" valign="top" align="left">x</td>
<td id="_6f440735-724f-a618-60b8-e2d7e269821b" valign="top" align="left">)) of the given input tensor element-wise.</td>
</tr></tbody>
</table>

<dl id="_99d08e08-d636-fe70-b4c5-6ed84db03d33"><dt>Domain</dt>
<dd id="_6af893fa-06af-15fb-d77d-76aa37c5ebfd"><p id="_241a2f67-7d22-0716-19f1-930596b1e810"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_9426eaf5-be5e-9f01-9117-fdf2d9157a07"><p id="_bd71d194-5fd5-086f-07b4-40dc9513e386">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_5a3f2bcc-4b83-fdcc-031e-2aec998d4eed"><p id="_b6c8932a-03bc-b361-7c13-c98a452f7e8c">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_4ef593ed-7f0e-3b22-bed9-124946126628"><p id="_8497b080-8619-8d85-ff3c-c361262cabba"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_1a3a071a-b95b-590e-5a8f-7e6037a2ec33"><p id="_f6eb0153-efe1-3485-285b-3c669df6bf67"><tt>output (differentiable) : T</tt> — [cols=3*] |=== | The softsign (x/(1+ | x | )) values of the input tensor computed element-wise |===</p>
</dd>
<dt>Attributes</dt>
<dd id="_b6efb987-d06c-8db4-460d-54b4557fb1af"><p id="_3969fd54-9c1b-62a8-b3cc-72ebf7552a6f">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_d300814f-39e4-f749-0cd2-b89b5dba291e"><p id="_209e35c4-01be-7055-9502-432c210d3f7b"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_fd358407-9a0e-b928-b803-6eaa10aaa9b6"><p id="_b39346d2-0a41-99d3-da15-4e0b77337326"><tt>test_softsign_example</tt>, <tt>test_softsign</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_d089e67a-c056-f393-4cbc-46bc3aa1b14a"><p id="_dcf84ae6-af50-aacf-da9a-cbe2bd729d31">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_c0b1ca56-1c44-2b19-2c26-b3cb05b12a5a" anchor="op-ai-onnx-default-spacetodepth" obligation="normative">
<title id="_d53f898e-8a3a-19c1-0023-a1cc7e3856e7">SpaceToDepth</title>
<p id="_dde0f7a3-e40f-baa6-1939-97977850ba5e">SpaceToDepth rearranges blocks of spatial data into depth. More specifically, this op outputs a copy of the input tensor where values from the height and width dimensions are moved to the depth dimension.  <tt>mode</tt> determines whether blocks are ordered depth-column-row (<tt>DCR</tt>, the default) or column-row-depth (<tt>CRD</tt>).</p>

<dl id="_a6f2a2f9-61bf-15cd-673d-2161b366bf0e"><dt>Domain</dt>
<dd id="_02d661c7-ea48-cba9-12c1-4be24846c644"><p id="_e184a236-84ad-ebd6-8b50-5b81957cfc5d"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_70c5189e-f93a-5929-58a8-7faf5ae7c469"><p id="_fc00ce8e-54af-2aa7-88f4-7f3f0121e141">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_3b5c3b4d-f7c6-e4fe-dc97-0cdbf3a61429"><p id="_d019e787-7d66-7fea-1119-61b59cd053e7">1, 13</p>
</dd>
<dt>Inputs</dt>
<dd id="_a70358d7-8bf7-8faf-0ac8-80b7f7ace3ad"><p id="_350ee7b4-09e6-6017-b61a-092f77c295a8"><tt>input (differentiable) : T</tt> — Input tensor of [N,C,H,W], where N is the batch axis, C is the channel or depth, H is the height and W is the width.</p>
</dd>
<dt>Outputs</dt>
<dd id="_e3bad754-6aa8-bc29-786e-907b5f192641"><p id="_5ca25d70-e11d-366a-cb8b-def8f10ff879"><tt>output (differentiable) : T</tt> — Output tensor of [N, C * blocksize * blocksize, H/blocksize, W/blocksize].</p>
</dd>
<dt>Attributes</dt>
<dd id="_15d0c3bd-3857-bf15-9922-0a48d8979097"><p id="_f0fd0482-804a-1121-5a0f-95375009801a"><tt>blocksize : int (required)</tt> — Blocks of [blocksize, blocksize] are moved.<br/> <tt>mode : string (default is DCR)</tt> — DCR (default) for depth-column-row order re-arrangement. Use CRD for column-row-depth order.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_60673def-6a15-1a0f-059f-a803a2aef785"><p id="_d3e9ec3a-bf1f-4e68-3df0-178663ae8837"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input and output types to all tensor types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_b1859468-73b1-a16f-1a8b-31426b0cbb08"><p id="_bb06e580-9c82-ea9a-7a65-19d4166b60eb"><tt>test_spacetodepth_crd_mode_example</tt>, <tt>test_spacetodepth_dcr_mode_example</tt>, <tt>test_spacetodepth_example</tt>, <tt>test_spacetodepth</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_05534b5d-f043-a799-e295-69833c772f57"><p id="_bebf8eae-4251-2da2-2ee2-258f2866fcab">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_354b2307-92f5-bebc-f839-fcc43b36c23b" anchor="op-ai-onnx-default-split" obligation="normative">
<title id="_53ad46bb-91c3-4283-d7be-45f910ba2f14">Split</title>
<p id="_09b8a5c1-5f83-de4a-810b-922e6f814ba9">Split a tensor into a list of tensors, along the specified ‘axis’. Either input ‘split’ or the attribute ‘num_outputs’ should be specified, but not both. If the attribute ‘num_outputs’ is specified, then the tensor is split into equal sized parts. If the tensor is not evenly splittable into  <tt>num_outputs</tt>, the last chunk will be smaller. If the input ‘split’ is specified, it indicates the sizes of each output in the split.</p>

<dl id="_44b387bd-7423-eb91-9a90-03a8126c93c2"><dt>Domain</dt>
<dd id="_3c65b06b-6d67-7ff9-f66c-e368f5df49db"><p id="_bfb06a41-04ef-e398-e50a-c3d6b0e17d4b"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_6b3861ad-eb16-6d97-072b-9493fa8cdb30"><p id="_56b47607-7c1d-5e1e-a5e5-71e01d6b73e0">18</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_162eb57d-469c-1612-4974-bc44ddc52d53"><p id="_c43fa783-3009-f139-e6db-c527c8d3fc0d">1, 2, 11, 13</p>
</dd>
<dt>Inputs (1 — 2)</dt>
<dd id="_107342f1-cd58-247d-043e-30ad1e341fbe"><p id="_ae8d450c-49d4-feee-a05b-06f02c1bf67d"><tt>input (differentiable) : T</tt> — The tensor to split<br/> <tt>split (optional, non-differentiable) : tensor(int64)</tt> — Optional length of each output. Values should be &gt;= 0.Sum of the values must be equal to the dim value at ‘axis’ specified.</p>
</dd>
<dt>Outputs (1 — unbounded)</dt>
<dd id="_3cc11c47-513d-87e4-42d6-c690f4ab317c"><p id="_8c8d6d12-45a2-e509-9aa5-4c022d82081b"><tt>outputs (variadic, differentiable) : T</tt> — One or more outputs forming list of tensors after splitting</p>
</dd>
<dt>Attributes</dt>
<dd id="_d89939bc-c5d8-3143-34be-b3848d40a92f"><p id="_817dcc66-89f3-a9bb-fb17-bb90f43a310b"><tt>axis : int (default is 0)</tt> — Which axis to split on. A negative value means counting dimensions from the back. Accepted range is [-rank, rank-1] where r = rank(input).<br/> <tt>num_outputs : int</tt> — Number of outputs to split parts of the tensor into. If the tensor is not evenly splittable the last chunk will be smaller.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_88ea4bf9-d885-f4b2-9687-fd5b9b35b42f"><p id="_d8e2c3b0-c48f-e752-ace9-db7c22d13db6"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input and output types to all tensor types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_3ad1f6cf-89ae-b24f-bfc1-b5fcf775b74c"><p id="_d1e772c9-2e0e-083b-9f73-750699c684bc"><tt>test_split_equal_parts_1d_opset13</tt>, <tt>test_split_variable_parts_1d_opset13</tt>, <tt>test_split_equal_parts_1d_opset18</tt>, <tt>test_split_variable_parts_1d_opset18</tt>, <tt>test_split_1d_uneven_split_opset18</tt>, <tt>test_split_equal_parts_2d_opset13</tt>, <tt>test_split_variable_parts_2d_opset13</tt>, <tt>test_split_equal_parts_2d</tt>, <tt>test_split_variable_parts_2d_opset18</tt>, <tt>test_split_2d_uneven_split_opset18</tt>, <tt>test_split_equal_parts_default_axis_opset13</tt>, <tt>test_split_variable_parts_default_axis_opset13</tt>, <tt>test_split_equal_parts_default_axis_opset18</tt>, <tt>test_split_variable_parts_default_axis_opset18</tt>, <tt>test_split_zero_size_splits_opset13</tt>, <tt>test_split_zero_size_splits_opset18</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_3dbc0deb-ce42-2cc5-e5a3-5442825d22f1"><p id="_acfe0d15-ee68-e617-749d-7d4e564aa83d">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_35e7329b-50e1-8b14-30da-65c92fe5ad32" anchor="op-ai-onnx-default-splittosequence" obligation="normative">
<title id="_45794b77-a2fb-6af4-4783-10b842fe0527">SplitToSequence</title>
<p id="_ea215f5c-aa98-565d-be87-563854395bf7">Split a tensor into a sequence of tensors, along the specified ‘axis’. Lengths of the parts can be specified using the optional argument ‘split’. If the argument  <tt>split' is not specified, a default scalar value of 1 is used as the value of  </tt>split’. ‘split’ must contain only positive numbers. ‘split’ is either a scalar (tensor of empty shape), or a 1-D tensor. If ‘split’ is a scalar, then ‘input’ will be split into chunks all of size ‘split’ if possible. The last chunk alone may be smaller than ‘split’ if the ‘input’ size along the given axis ‘axis’ is not divisible by ‘split’. If ‘split’ is a 1-dimensional tensor, the input tensor is split into ‘size(split)’ chunks, with lengths of the parts on ‘axis’ specified in ‘split’. In this scenario, the sum of entries in ‘split’ must be equal to the dimension size of input tensor on ‘axis’.</p>

<dl id="_cfa7b4d2-5c66-0877-03f5-adef31897d6e"><dt>Domain</dt>
<dd id="_42a7d839-8fa3-8bf4-bc77-322f8a1debe2"><p id="_214d51e7-d91f-99a1-dd2e-5a15d323e838"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_b67e144f-757b-aa82-84a1-a437580af41a"><p id="_7e617783-54c8-29bc-d3c2-3e8f16d1ebca">24</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_f5881c25-f931-77a7-245e-975bd7022541"><p id="_96ec86f9-1701-e79b-bd84-cb654c139347">11</p>
</dd>
<dt>Inputs (1 — 2)</dt>
<dd id="_5bc058f8-d38e-b15c-ed77-58fdb55a1351"><p id="_8288e66b-94d5-c5f3-7e49-8959c32b42ac"><tt>input : T</tt> — The tensor to split<br/> <tt>split (optional) : I</tt> — Length of each output. It can be either a scalar(tensor of empty shape), or a 1-D tensor. All values must be &gt;= 0.</p>
</dd>
<dt>Outputs</dt>
<dd id="_b7232d06-1562-59a6-93c5-effe8beb321e"><p id="_0fa518f5-bb5f-40da-adbd-711613fca83a"><tt>output_sequence : S</tt> — One or more outputs forming a sequence of tensors after splitting</p>
</dd>
<dt>Attributes</dt>
<dd id="_3c63c0ef-3cc2-2646-3d84-9e517d701309"><p id="_a017c974-d876-0d6c-2a24-efe7e87d59be"><tt>axis : int (default is 0)</tt> — Which axis to split on. A negative value means counting dimensions from the back. Accepted range is [-rank, rank-1].<br/> <tt>keepdims : int (default is 1)</tt> — Keep the split dimension or not. Default 1, which means we keep split dimension. If input ‘split’ is specified, this attribute is ignored.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_88c0cd99-baa9-0d75-302a-9bc18c431795"><p id="_2ab1e9d0-73ed-acd8-d21e-86074a49c740"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input types to all tensor types.<br/> <tt>I : tensor(int32), tensor(int64)</tt> — Constrain split size to integral tensor.<br/> <tt>S : seq(tensor(uint8)), seq(tensor(uint16)), seq(tensor(uint32)), seq(tensor(uint64)), seq(tensor(int8)), seq(tensor(int16)), seq(tensor(int32)), seq(tensor(int64)), seq(tensor(bfloat16)), seq(tensor(float16)), seq(tensor(float)), seq(tensor(double)), seq(tensor(string)), seq(tensor(bool)), seq(tensor(complex64)), seq(tensor(complex128))</tt> — Constrain output types to all tensor types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_0f9a6151-f661-0862-9660-b2ac5580e6b7"><p id="_1b876f2d-8d1c-a50f-5827-51f6a555d6b1"><tt>test_split_to_sequence_nokeepdims</tt>, <tt>test_split_to_sequence_1</tt>, <tt>test_split_to_sequence_2</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_dd0af6d9-0ec4-a60e-4654-f966e8d72f9c"><p id="_f142cc94-d6c5-9271-1e92-4c2bfa14ee43">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_52e1a461-fa86-bc68-470a-91b623624f60" anchor="op-ai-onnx-default-sqrt" obligation="normative">
<title id="_c4a3addd-cab7-ed52-ecb4-59fb433a65e6">Sqrt</title>
<p id="_eb3e3430-ded6-16ae-9f10-3b90461aa68d">Square root takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the square root is, y = x^0.5, is applied to the tensor elementwise. If x is negative, then it will return NaN.</p>

<dl id="_6cbd64fe-26f1-959c-bcaf-a79fa3dafb6d"><dt>Domain</dt>
<dd id="_d6c14969-b8f6-ac24-d8f2-df536edd0b7a"><p id="_80d90b7c-f2d2-4ffb-e90a-e48363c9597d"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_9fa4bc89-77cd-0bc8-dd45-acd4eaa24e57"><p id="_80d2344f-b61f-2301-e22d-d2ec65a93601">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_6041f814-0fc9-742e-364d-f21492bf6f26"><p id="_135acc10-0c80-7a9b-9007-6a1bf2441ea9">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_587462e5-8668-b8b8-8ce3-e3bed0c1cdfc"><p id="_43219f0a-a5fc-4e81-daed-730c9bb5b3c3"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_17549cd4-94b8-f079-46cc-88363e3f2b90"><p id="_ff04c721-a98e-c6e0-22cc-348f22a99053"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_e8c29cbb-79e9-7c39-6be0-79a4cd0d8a82"><p id="_34cec899-9675-7dc6-8df8-6da06ef4c9d8">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_ba1a08da-135a-d7a5-46ca-096b0c5064ee"><p id="_e81589cf-a604-ca5a-7d61-e6b09a24132f"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_6371148c-404a-9676-690c-d19fe4f1359a"><p id="_7bf158af-021d-f371-829e-cc0c2a82e79d"><tt>test_sqrt_example</tt>, <tt>test_sqrt</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_4b391028-f65a-b6f6-2efb-97fb3e7f416a"><p id="_7d8977b7-1a33-2dc9-472c-ba0dfaefdcbe">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_e25eade9-3182-3b67-bd3c-48ff2b52a855" anchor="op-ai-onnx-default-squeeze" obligation="normative">
<title id="_1d0daabf-d289-8f5f-9ecb-3f3c607d0ed3">Squeeze</title>
<p id="_35834624-d516-f6cb-5808-ac46e597fe75">Remove single-dimensional entries from the shape of a tensor. Takes an input  <tt>axes</tt> with a list of axes to squeeze. If  <tt>axes</tt> is not provided, all the single dimensions will be removed from the shape. If an axis is selected with shape entry not equal to one, an error is raised.</p>

<dl id="_8161ec85-6f98-1554-cc25-b330caa035c2"><dt>Domain</dt>
<dd id="_ceb20d72-0051-4b92-10ed-5c04d3d9f2bd"><p id="_381b9153-798d-6363-45af-859a5c8940d7"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_8c6f8baa-f13f-8f59-45b1-58cce22cc4b7"><p id="_79374e4a-1e1e-76e5-3e3c-9254cf5755a4">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_ecfc3596-bfff-65a1-f0d2-10ebe6a5bf4d"><p id="_c72ac52f-483e-4540-d4fb-2f3fe09b0fd5">1, 11, 13, 21, 23, 24</p>
</dd>
<dt>Inputs (1 — 2)</dt>
<dd id="_684b4f23-5e40-e8cb-1439-0a45c94c5750"><p id="_084d747f-545e-4d4a-7013-c5b4a52a0abc"><tt>data (differentiable) : T</tt> — Tensors with at least max(dims) dimensions.<br/> <tt>axes (optional, non-differentiable) : tensor(int64)</tt> — 1D tensor of integers indicating the dimensions to squeeze. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(data).</p>
</dd>
<dt>Outputs</dt>
<dd id="_086eb56f-a7b5-a948-abe1-07c3b7aaefc9"><p id="_5175afb6-ea5e-b30b-f212-b01023a20416"><tt>squeezed (differentiable) : T</tt> — Reshaped tensor with same data as input.</p>
</dd>
<dt>Attributes</dt>
<dd id="_88425971-e396-d2e5-9a1f-9461ddd8b44a"><p id="_818cb2b6-ed56-7153-1173-a9238cc978d4">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_71355351-f8f8-6166-7309-f7951c7158b0"><p id="_9f9b4572-2d0e-4384-c407-6d520c278757"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2)</tt> — Constrain input and output types to all tensor types up to IRv13.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_cc83d85e-9f74-a38e-1a93-29f764022720"><p id="_36c6feba-0d5a-24a6-2cd6-aca29697a2e9"><tt>test_squeeze</tt>, <tt>test_squeeze_negative_axes</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_cc9642c0-c7e6-46a7-aae4-a6a7f25d6a18"><p id="_662f3d81-8210-11fe-b76a-f078e10bbf5b">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_1cb13a54-e26e-f33b-f6ef-3999fc2bc708" anchor="op-ai-onnx-default-stringconcat" obligation="normative">
<title id="_e705f446-e328-9893-cd80-6c944bb576fd">StringConcat</title>
<p id="_08e24247-9882-920f-5dbe-757503b3fcc1">StringConcat concatenates string tensors elementwise (with NumPy-style broadcasting support)</p>

<dl id="_8037b463-57f7-9a4f-0a2f-81065bc169b9"><dt>Domain</dt>
<dd id="_280e5671-dff3-a7a6-170f-cf4e3349b6c4"><p id="_43223fb6-c436-7950-1b4e-4e361733fc11"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_16caea67-cfc7-5294-0eef-a191937fda6a"><p id="_f6b32c05-1158-8b6a-e2bb-d0bee7fe84d3">20</p>
</dd>
<dt>Inputs</dt>
<dd id="_7cefa87f-0f87-b95d-b4e8-072aa7fdac7e"><p id="_810da484-0cd8-7e60-0416-72d8594c01e5"><tt>X (non-differentiable) : T</tt> — Tensor to prepend in concatenation<br/> <tt>Y (non-differentiable) : T</tt> — Tensor to append in concatenation</p>
</dd>
<dt>Outputs</dt>
<dd id="_4ba15b5d-d45d-c7d8-57f5-112b4a5f78c3"><p id="_ba51c3ff-3e6a-2212-6e71-fd39f24e1d39"><tt>Z (non-differentiable) : T</tt> — Concatenated string tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_7e8bfc91-e23f-3b3b-fb5d-c717a74fd1b6"><p id="_cffe4a9c-e005-e9dd-ca22-e661d23c27c0">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_2c6ada1c-41e1-e582-c931-e0fe45bca0e5"><p id="_8b9229dd-dd9d-6fca-c9c9-65cddc168eef"><tt>T : tensor(string)</tt> — Inputs and outputs must be UTF-8 strings</p>
</dd>
<dt>Test vectors</dt>
<dd id="_82f63df0-25ce-372f-e244-58c8e370a8f1"><p id="_91133f04-6a98-001e-fea3-72371d8895d7"><tt>test_string_concat</tt>, <tt>test_string_concat_broadcasting</tt>, <tt>test_string_concat_zero_dimensional</tt>, <tt>test_string_concat_empty_string</tt>, <tt>test_string_concat_utf8</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_b1eee9c7-8eb4-d338-7077-e1f66b382c1d"><p id="_0f96fabe-63a1-f6c1-50bd-37854f78296a">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_c8a4a58c-5eec-96b0-664f-46d5ca7563ec" anchor="op-ai-onnx-default-stringnormalizer" obligation="normative">
<title id="_e92ac5fb-6625-4a33-30d2-73f25795afb6">StringNormalizer</title>
<p id="_06927bfa-f935-e1f6-097e-564ed726ee23">StringNormalization performs string operations for basic cleaning. This operator has only one input (denoted by X) and only one output (denoted by Y). This operator first examines the elements in the X, and removes elements specified in “stopwords” attribute. After removing stop words, the intermediate result can be further lowercased, uppercased, or just returned depending the “case_change_action” attribute. This operator only accepts [C]- and [1, C]-tensor. If all elements in X are dropped, the output will be the empty value of string tensor with shape [1] if input shape is [C] and shape [1, 1] if input shape is [1, C].</p>

<dl id="_60b8e065-1ec9-13a2-9cae-ad9af1726855"><dt>Domain</dt>
<dd id="_3b45ad94-1807-b40a-129b-71b3e6b0bfbd"><p id="_907aeb3e-1bd1-508d-0788-aa5f55134316"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_0ee10578-f61e-f82a-a10e-fea08d5149f6"><p id="_935cf5ab-d0cb-5af4-722b-e27b882e1ba6">10</p>
</dd>
<dt>Inputs</dt>
<dd id="_defa5bfc-233b-df45-a2b6-521b7512a116"><p id="_599313d4-73ea-e82d-2cb4-9e684f1b8472"><tt>X : tensor(string)</tt> — UTF-8 strings to normalize</p>
</dd>
<dt>Outputs</dt>
<dd id="_18e2609b-e8fa-ba08-2855-d5f49765eda9"><p id="_d76225fa-577e-8e9e-e5f3-e13eb5eb4562"><tt>Y : tensor(string)</tt> — UTF-8 Normalized strings</p>
</dd>
<dt>Attributes</dt>
<dd id="_97d102ea-f865-959b-470d-da3a424fe4e2"><p id="_22f78cac-8ce1-43a7-0cdf-7dd24ec2a78a"><tt>case_change_action : string (default is NONE)</tt> — string enum that cases output to be lowercased/uppercases/unchanged. Valid values are “LOWER”, “UPPER”, “NONE”. Default is “NONE”<br/> <tt>is_case_sensitive : int (default is 0)</tt> — Boolean. Whether the identification of stop words in X is case-sensitive. Default is false<br/> <tt>locale : string</tt> — Environment dependent string that denotes the locale according to which output strings needs to be upper/lowercased.Default en_US or platform specific equivalent as decided by the implementation.<br/> <tt>stopwords : list of strings</tt> — List of stop words. If not set, no word would be removed from X.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_f48cad3c-30d3-fe47-95ec-33628e253f6d"><p id="_c669733a-8b0a-51ff-08d8-f047788993ec">None.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_49897ab3-5886-99fb-2bc8-c2eba49ada21"><p id="_7c50e05d-42ca-530c-c2e6-b801624eefac"><tt>test_strnormalizer_export_monday_casesensintive_lower</tt>, <tt>test_strnormalizer_export_monday_casesensintive_nochangecase</tt>, <tt>test_strnormalizer_export_monday_casesensintive_upper</tt>, <tt>test_strnormalizer_export_monday_empty_output</tt>, <tt>test_strnormalizer_export_monday_insensintive_upper_twodim</tt>, <tt>test_strnormalizer_nostopwords_nochangecase</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_34311e41-dae6-b5fe-a102-fef300341da3"><p id="_7cd79330-04ab-90fe-b962-e1d7b8e63d5c">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_86abfd73-f2b3-5d17-33c4-f4650d52e105" anchor="op-ai-onnx-default-stringsplit" obligation="normative">
<title id="_3de3f653-a579-9abf-99a4-d9f516b0c549">StringSplit</title>
<p id="_bbd6fd63-6d92-6f05-549b-aae686c2c627">StringSplit splits a string tensor’s elements into substrings based on a delimiter attribute and a maxsplit attribute.</p>

<p id="_c7e9888b-a425-d028-fcf6-96d0e7d41aeb">The first output of this operator is a tensor of strings representing the substrings from splitting each input string on the <tt>delimiter</tt> substring. This tensor has one additional rank compared to the input tensor in order to store the substrings for each input element (where the input tensor is not empty). Note that, in order to ensure the same number of elements are present in the final dimension, this tensor will pad empty strings as illustrated in the examples below. Consecutive delimiters are not grouped together and are deemed to delimit empty strings, except if the <tt>delimiter</tt> is unspecified or is the empty string (“”). In the case where the <tt>delimiter</tt> is unspecified or the empty string, consecutive whitespace characters are regarded as a single separator and leading or trailing whitespace is removed in the output.</p>

<p id="_44416f05-ce64-e109-3c12-aac3ce72c049">The second output tensor represents the number of substrings generated. <tt>maxsplit</tt> can be used to limit the number of splits performed — after the <tt>maxsplit</tt>th split if the string is not fully split, the trailing suffix of input string after the final split point is also added. For elements where fewer splits are possible than specified in <tt>maxsplit</tt>, it has no effect.</p>

<dl id="_99e647b7-2a4a-1a6f-9575-1a35009b5e29"><dt>Domain</dt>
<dd id="_1c7a565e-a373-bbb4-4b60-f168c7747866"><p id="_5f530efb-105a-c456-f368-84e43bab4e50"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_0baf45ee-c781-d68b-1d36-fda7a338f696"><p id="_b9a46d00-f679-b479-681a-c21033da0805">20</p>
</dd>
<dt>Inputs</dt>
<dd id="_454e485b-2b64-c2a9-a64d-bdf480e5047e"><p id="_e6c65eb8-60e5-f5d8-55da-fde482697592"><tt>X (non-differentiable) : T1</tt> — Tensor of strings to split.</p>
</dd>
<dt>Outputs</dt>
<dd id="_544db262-d6fe-296e-ae3e-dce887083767"><p id="_8aa502fe-2aa2-d05b-5586-699e6332e4bc"><tt>Y (non-differentiable) : T2</tt> — Tensor of substrings representing the outcome of splitting the strings in the input on the delimiter. Note that to ensure the same number of elements are present in the final rank, this tensor will pad any necessary empty strings.<br/> <tt>Z (non-differentiable) : T3</tt> — The number of substrings generated for each input element.</p>
</dd>
<dt>Attributes</dt>
<dd id="_23f66f2d-0dfd-a236-9bc1-7bc48d97723e"><p id="_2bd773b0-1898-5d19-a52c-c7e70487182b"><tt>delimiter : string</tt> — Delimiter to split on. If left unset or set to the empty string (“”), the input is split on consecutive whitespace.<br/> <tt>maxsplit : int</tt> — Maximum number of splits (from left to right). If left unset (or if the number of possible splits are less than maxsplit), it will make as many splits as possible. Note that the maximum possible number of substrings returned with <tt>maxsplit</tt> specified is <tt>maxsplit+1</tt> since the remaining suffix after the <tt>maxsplit</tt>th split is included in the output.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_895db6d5-dff3-c90e-bf91-e9474c73ed65"><p id="_4e144bd7-3938-af42-64ba-230305ec7c0c"><tt>T1 : tensor(string)</tt> — The input must be a UTF-8 string tensor<br/> <tt>T2 : tensor(string)</tt> — Tensor of substrings.<br/> <tt>T3 : tensor(int64)</tt> — The number of substrings generated.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_049f9578-731c-b2ac-d009-99890e3b3e56"><p id="_de78b7c3-81a8-908c-d3ba-e036ff5fb369"><tt>test_string_split_basic</tt>, <tt>test_string_split_consecutive_delimiters</tt>, <tt>test_string_split_empty_tensor</tt>, <tt>test_string_split_maxsplit</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_07480833-487e-4e80-82e0-1f069de2699a"><p id="_c90e6be2-31d6-fb72-d78a-3fc9d663681f">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_afbf1c8f-679d-b1f2-6fcc-2f8da987cf9d" anchor="op-ai-onnx-default-sub" obligation="normative">
<title id="_87b48e60-e34c-d699-300d-bb5e84e8d571">Sub</title>
<p id="_dfc24bab-0ccf-1197-a203-3ecfc4fc719b">Performs element-wise binary subtraction (with Numpy-style broadcasting support).</p>

<p id="_016b794b-6a75-ba13-acf5-31d397ab6bab">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<p id="_97fd7499-7384-dc26-92e7-42d596d78c18">(Opset 14 change): Extend supported types to include uint8, int8, uint16, and int16.</p>

<dl id="_5b0e3284-98e2-d61e-ec85-89781c07d36f"><dt>Domain</dt>
<dd id="_c5ae36ce-73b7-1e77-2fa5-d9415d63b0a6"><p id="_6946ff8c-73f3-05c2-7481-342fbb3c7745"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_5467c47a-9b86-0a30-110f-82663984bd94"><p id="_1b27982a-848e-119c-ad77-928da01bbd0d">14</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_c04afe58-35af-4c7a-fa75-0bb5d000eec5"><p id="_940b3365-c102-0e69-c0ad-d93d6620a187">1, 6, 7, 13</p>
</dd>
<dt>Inputs</dt>
<dd id="_c9ed7ad0-a3d8-98ab-1e74-d47f4a901447"><p id="_1e88ac23-e8f3-f537-5aa2-584ae489b6e7"><tt>A (differentiable) : T</tt> — First operand.<br/> <tt>B (differentiable) : T</tt> — Second operand.</p>
</dd>
<dt>Outputs</dt>
<dd id="_c69e5380-cdd2-7d29-9b3e-387c32283a31"><p id="_9dbb8e18-6e62-5716-605c-92814d1e2aca"><tt>C (differentiable) : T</tt> — Result, has same element type as two inputs</p>
</dd>
<dt>Attributes</dt>
<dd id="_e5bdd3e0-87a7-c7ba-d174-68310303f101"><p id="_1291fff1-9280-637b-b9ae-cf8b41557160">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_2f206448-1bc8-1e7d-5698-a554f41159fc"><p id="_d35037ff-7790-6008-2e2b-324e3e34ccca"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to all numeric tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_344904d5-4e3b-fa03-fad9-875a61eb27e2"><p id="_653217fc-8e17-fcb1-c23f-0c9a06401b63"><tt>test_sub_example</tt>, <tt>test_sub</tt>, <tt>test_sub_int8</tt>, <tt>test_sub_int16</tt>, <tt>test_sub_uint8</tt>, <tt>test_sub_uint16</tt>, <tt>test_sub_uint32</tt>, <tt>test_sub_uint64</tt>, <tt>test_sub_bcast</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_0e3b3185-b0ca-64a0-db3c-d99ae4e8de93"><p id="_5607c862-6d51-c1fa-4e17-217d3a3ff9f8">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_3358f9bb-413f-9407-ea2e-6ab04f9c41f8" anchor="op-ai-onnx-default-sum" obligation="normative">
<title id="_3b699130-a2a5-bf77-24ff-54631acee442">Sum</title>
<p id="_ceb4d8b0-afa0-2776-fbad-2ab7a63174ed">Element-wise sum of each of the input tensors (with Numpy-style broadcasting support). All inputs and outputs must have the same data type. This operator supports  <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_d46a2166-7c2f-1c28-7057-2812614b9f1f"><dt>Domain</dt>
<dd id="_74558fe5-e85b-3088-ce2b-9f5dbeb24e8e"><p id="_7b45c117-db76-e8e6-eb31-e670f711c260"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_aa14f03e-3843-b660-ea5d-9a20c422c6c7"><p id="_2554691c-4203-8899-db55-abbd689302ca">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_a7af90cc-0648-457e-4756-5de7f6fdcc6c"><p id="_d13bcf96-a49d-ef00-5805-14629fe3f55c">1, 6, 8</p>
</dd>
<dt>Inputs (1 — unbounded)</dt>
<dd id="_2fd0f91b-05e8-4b7e-74c6-9fffe61d9798"><p id="_7344afab-3360-c6e1-1532-78f39d85d6f4"><tt>data_0 (variadic, differentiable) : T</tt> — List of tensors for sum.</p>
</dd>
<dt>Outputs</dt>
<dd id="_f77233b5-aa3c-a74c-c83d-d7794a1526bb"><p id="_79383bf7-ed1a-cf4a-4bbe-6889c9a6f98b"><tt>sum (differentiable) : T</tt> — Output tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_536a572a-7fe7-7e50-2d9a-c177e3ad412a"><p id="_d05c7fcf-8893-d662-2e8a-fa5c99856c70">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_a2d2f26f-d22b-2769-56ff-a6ab5fc41150"><p id="_246bb3ec-2f8d-05d4-c224-5d6b78dffaf9"><tt>T : tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_5b4f4f28-5c20-97e1-3c75-abcbda3168ca"><p id="_23ef30b2-6695-4c8e-128f-f5a1c2223f4b"><tt>test_sum_example</tt>, <tt>test_sum_one_input</tt>, <tt>test_sum_two_inputs</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_b4e557e3-c53d-3a17-2ffc-88d3052fc50a"><p id="_f0af5f8f-facd-1cae-aed4-42ebd8d84267">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_8888045e-0401-dc58-d380-54cc794b842f" anchor="op-ai-onnx-default-swiglu" obligation="normative">
<title id="_cb74ec63-45a3-4f48-3576-cc4897b3ad68">SwiGLU</title>
<p id="_49deb45f-83b1-2f92-ce0e-ab3fbc66eaee">SwiGLU is a gated activation that takes two inputs, a gate <tt>A</tt> and a linear (value) input  <tt>B</tt>, and produces one output <tt>Y</tt>. It applies the Swish activation to the gate and multiplies the result elementwise by the linear input:</p>

<sourcecode id="_5a0251e2-0f0e-d094-0f4a-be9af4d484d8" unnumbered="true"><body>Y = Swish_alpha(A) * B</body></sourcecode>


<p id="_138886ed-de91-0f9b-84f9-fe5861acf28f">The gate activation <tt>Swish_alpha</tt> is exactly the <tt>Swish</tt> operator with the same <tt>alpha</tt>, i.e. <tt>Swish_alpha(a) = a * Sigmoid(alpha * a)</tt>. Inputs <tt>A</tt> and <tt>B</tt> must have identical shapes; broadcasting is not applied and the output  <tt>Y</tt> has the same shape as the inputs.</p>

<p id="_ea84eaa3-7ef1-df40-bb09-8b1e1895c602">Exporters typically produce <tt>A</tt> and <tt>B</tt> in one of two ways: for the common two-projection form (e.g. Llama’s  <tt>gate_proj</tt>/<tt>up_proj</tt>) wire the two projection outputs directly to  <tt>A</tt> (gate) and <tt>B</tt> (value); for a fused/packed single projection, split it upstream into  <tt>A</tt> and <tt>B</tt> with <tt>Split</tt> (contiguous layout) or  <tt>Slice</tt>/<tt>Gather</tt> (interleaved layout).</p>

<dl id="_a8e07ad4-0240-8bb9-bbcd-5b94ca327de1"><dt>Domain</dt>
<dd id="_88647cd3-b1b4-5d1a-96ec-b4bc152f1269"><p id="_995df541-4bf5-a2f3-5e2a-c6fb727e32c2"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_9a0a15bc-d8bc-d44e-7d4e-0b4f147fe4a8"><p id="_6c173a8b-22b6-f5de-12b3-3f92fda017ae">28</p>
</dd>
<dt>Inputs</dt>
<dd id="_ef2266d5-6943-4788-0fb2-4b15b4606aac"><p id="_a90553b0-0f16-d378-c0fa-2536fa8c60e7"><tt>A (differentiable) : T</tt> — Gate input tensor<br/> <tt>B (differentiable) : T</tt> — Linear (value) input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_4073af62-b800-9fde-06ff-3c06f4ef0a05"><p id="_40793e43-5df0-8696-8e64-5cec09041272"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_c9c42d00-6e44-e2ce-10f8-ae3b966a9e08"><p id="_6e404d14-1aac-6c66-f132-5562218182c6"><tt>alpha : float (default is 1.0)</tt> — Coefficient that scales the gate input inside the sigmoid of the Swish activation. The default value is 1.0.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_ff53e717-9a80-6247-711c-d0e4fc590508"><p id="_8bdec66d-4605-4dfd-4aaf-9ac69124c2d5"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_89943052-429c-b5ba-237b-bfee879d320b"><p id="_51b49bd7-5d5a-c414-a344-d9d96f2ed196"><tt>test_swiglu_alpha</tt>, <tt>test_swiglu_float16</tt>, <tt>test_swiglu</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_733788c2-2276-3175-3621-dd67ccdfc965"><p id="_f92673a7-438a-5ae8-f48d-00bf6bb27eb6">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_eabb5f9c-292a-22c6-a508-7af274149156" anchor="op-ai-onnx-default-swish" obligation="normative">
<title id="_a7fffe04-a2d9-d9cf-1417-29bd2b6dc94c">Swish</title>
<p id="_874172f6-c8c7-ba36-0b6e-ca09de61e117">Swish function takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) of the same shape, where $Swish(x) = x * sigmoid(alpha * x)$.</p>

<dl id="_4a1c144c-cac7-e22d-298d-b174ccbe55d3"><dt>Domain</dt>
<dd id="_429347ef-e90d-fd28-76cf-d66a7b45b70a"><p id="_ab7e61f9-9e89-3f81-d75c-21d6638003c6"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_e9043a26-ece0-8854-d77c-3890f73249b0"><p id="_ac906511-bd8e-7b0f-5edf-2203c07da8ee">24</p>
</dd>
<dt>Inputs</dt>
<dd id="_66525447-86d5-ca57-0fd7-7a352bf39740"><p id="_e644f68b-ff6a-ad6e-b897-a17b79dbdce7"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_28b12d22-bb41-1107-e3f1-8f13a0773d80"><p id="_783cc419-c798-f899-4496-73049898cdc8"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_dcc0d96b-eaae-b502-dab6-e5d15ce0a4da"><p id="_b13ab90a-daea-de60-c95d-71ec26e19329"><tt>alpha : float (default is 1.0)</tt> — Coefficient to multiply with input before sigmoid.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_717bd4eb-b239-0495-4bf4-9c692de8bef5"><p id="_7d286f0b-ced4-53a0-e59e-b7e41b3f6f3d"><tt>T : tensor(float16), tensor(float), tensor(bfloat16), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_67e10423-ac33-7fd3-05e4-cb73e0bf5e2e"><p id="_e4f65460-b0a0-83e3-cd23-5762617251dd"><tt>test_swish</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_ca1652f5-81ed-1f4c-cd59-0052bc904545"><p id="_c3661943-400e-8857-920c-e9dfbf1d5db3">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_842f823e-2424-c1d4-f57f-1d03a57fd7c0" anchor="op-ai-onnx-default-tan" obligation="normative">
<title id="_cb9f352c-2413-8896-27bd-59b63a4687d0">Tan</title>
<p id="_af0ad136-18b7-ce1c-38a4-a5b334815a18">Calculates the tangent of the given input tensor, element-wise.</p>

<dl id="_49ce891f-399a-6daa-c688-2b010f4193b2"><dt>Domain</dt>
<dd id="_bcecdc7c-1a78-65d4-3a20-ad7b3343509a"><p id="_54d8026e-1a4d-d3b8-1ffa-463630e9c009"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_a3db6e63-d6c2-1177-b9bb-2f4e1b99fa68"><p id="_f9860a29-40f2-e45a-763e-acb349cde61b">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_361fdb85-bf49-fade-cdd7-fd25bcef5d3f"><p id="_f6d31d75-4dfc-f6c3-3103-66146354e887">7</p>
</dd>
<dt>Inputs</dt>
<dd id="_da37484e-b95a-3473-0d66-94aeec2e8e8b"><p id="_a83cd748-8f31-7978-fd9d-4ad8ab8ee851"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_da25575e-b778-11f7-8354-3945c729006f"><p id="_e48db332-b8fc-117e-3f1a-0affa7bd0c60"><tt>output (differentiable) : T</tt> — The tangent of the input tensor computed element-wise</p>
</dd>
<dt>Attributes</dt>
<dd id="_644a268d-617c-18a5-3900-d87835bd3703"><p id="_dc596625-f8a5-9c42-0173-452b3d002874">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_6a465542-ed06-ea9c-fa00-41af624a0a4f"><p id="_47f040b1-4c4d-a69c-84ae-36227b9681ca"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_ebaaa2c9-bf40-5069-e337-6b4e00a71e4b"><p id="_079c4967-0bbd-61e7-f681-d11468bbe1dd"><tt>test_tan_example</tt>, <tt>test_tan</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_5a7f049b-ca98-b675-965f-8f30e09b9ed9"><p id="_8517609e-2080-b4ec-eecb-d5b7bf6f285f">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_07732bfe-adc8-bcc5-a51c-f3900aac17e7" anchor="op-ai-onnx-default-tanh" obligation="normative">
<title id="_ea51f428-c962-6725-800c-d96e0b47ca6e">Tanh</title>
<p id="_11fde731-2a89-8b82-f437-413b53c6f982">Calculates the hyperbolic tangent of the given input tensor element-wise.</p>

<dl id="_71e9ed28-98c7-99e7-7036-9994a60b83aa"><dt>Domain</dt>
<dd id="_2a3fcc41-c34c-994a-0353-7baad35dc349"><p id="_9145daf4-1948-ac21-4148-6ebe9ad80897"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_a69831d3-2cfe-6b7f-8045-3cee93494380"><p id="_0d95deda-5eb2-e4f9-5e2d-0108b1da78fb">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_84a37541-ae95-40fe-ecff-1e8267d49f3e"><p id="_c175ea42-0688-792d-d9c6-050c2cbc73b7">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_08aaceae-b6aa-0959-2c65-14cbb25809e7"><p id="_7e273d86-ee34-e0a1-86b6-c6c53217f67a"><tt>input (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_1b84a15d-9eec-88eb-7a7e-21e4ebd62b12"><p id="_fac3022b-bdd2-3a72-7970-034cb31cc22e"><tt>output (differentiable) : T</tt> — The hyperbolic tangent values of the input tensor computed element-wise</p>
</dd>
<dt>Attributes</dt>
<dd id="_01f356a2-35ec-3f1c-5b20-8d114eebb5c3"><p id="_37552710-a9c3-9d2b-cdfd-1d3b36085792">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_fb13ab22-65fb-bafa-925d-a0db79ebaae2"><p id="_97d5692a-bd78-3944-83ec-71d43b8aaf59"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_86a3b15e-37a8-bd23-20d2-5ccb4e0ff994"><p id="_eedab9f5-2108-9aed-1fd2-b31107b7eee1"><tt>test_tanh_example</tt>, <tt>test_tanh</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_df2fabe7-4f67-e0a4-8e51-5cc0524253d3"><p id="_0d0848b7-b750-8d55-768d-9ee49d895f70">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_6fb081d9-511e-415b-cf64-20d9f75525bb" anchor="op-ai-onnx-default-tensorscatter" obligation="normative">
<title id="_6a56100c-2009-7c34-ac55-22623c032c8c">TensorScatter</title>
<p id="_2d69b975-6e01-0809-9b1c-ff30e656c14a">TensorScatter is a generic tensor update operation, motivated by the requirements for KV cache updates for Attention ops commonly found in LLMs. It is a functional operation that models an in-place update to a KV cache buffer.</p>

<p id="_b87e19c9-b252-5f96-ffe1-6549f0a6129d">The past and present cache tensors have the same shape (batch_size, D1, D2, …​, max_sequence_length, …​, Dn), with the sequence dimension (indicated by the  <tt>axis</tt> attribute) being max_sequence_length, so the sizes of these tensors do not need to grow between iterations. The  <tt>update</tt> tensor’s shape only differs from the cache tensors in the sequence dimension: (batch_size, D1, D2, …​, sequence_length, …​, Dn), where sequence_length &lt;= max_sequence_length.</p>

<p id="_46bfa397-4073-81ce-dd6d-52cce3dccb05">The optional <tt>write_indices</tt> input indicates the write index for each sample in the batch, assumed to be zero if not provided. When the  <tt>mode</tt> attribute is set to “circular”, the write index is modulo max_sequence_length. The operation can be described using the following pseudocode:</p>

<sourcecode id="_2c2231d7-f046-1308-32f0-851628200099" unnumbered="true"><body>for prefix_idx in np.ndindex(past_cache.shape[:axis]):
    batch_idx = prefix_idx[0]
    for sequence_idx in range(sequence_length):
        cache_sequence_idx = write_indices[batch_idx] + sequence_idx
        if mode == "circular":
            cache_sequence_idx = cache_sequence_idx % max_sequence_length
        cache_idx = (*prefix_idx, cache_sequence_idx)
        update_idx = (*prefix_idx, sequence_idx)
        present_cache[cache_idx] = update[update_idx]</body></sourcecode>


<p id="_c02352d2-cf48-2e61-00c8-1354b2937462">During the prefill phase of attention, only the first two inputs are needed. During the decode phase, <tt>write_indices</tt> is also needed so that the incoming key or value update can be appended after the last valid token for each sample in the batch.</p>

<dl id="_31d58936-87eb-3532-b8ed-926412c919d8"><dt>Domain</dt>
<dd id="_5fbc2f69-b505-3751-34c9-fa910cf0ae01"><p id="_6bd4ef59-814c-e3f5-a683-c78fc049852d"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_a33e272f-0714-d519-6bdd-d0df882945f5"><p id="_f3a74fd3-4680-936f-736c-111f1ebc41c3">24</p>
</dd>
<dt>Inputs (2 — 3)</dt>
<dd id="_8616e444-f4aa-2be9-5d6d-e97941c409dc"><p id="_c83e03c9-b4f1-5df5-baa0-fe7a61ef0453"><tt>past_cache (differentiable) : T</tt> — Past state cache for key or value with shape <tt>(batch_size, D1, D2, ..., max_sequence_length, ..., Dn)</tt>.<br/> <tt>update (differentiable) : T</tt> — New update tensor with shape <tt>(batch_size, D1, D2, ..., sequence_length, ..., Dn)</tt>.<br/> <tt>write_indices (optional, non-differentiable) : tensor(int64)</tt> — Write indices for the incoming update tensor in the cache. Shape is <tt>(batch_size,)</tt>. Assumed to be all zeros if not provided.</p>
</dd>
<dt>Outputs</dt>
<dd id="_54b97e11-2d77-6b1c-3452-fb7750dda304"><p id="_cfd882f3-b6f5-eda7-3543-ed844e6f17fe"><tt>present_cache (differentiable) : T</tt> — Updated cache. Same shape as <tt>past_cache</tt>.</p>
</dd>
<dt>Attributes</dt>
<dd id="_282a732e-9851-945c-1e50-7d675460a0db"><p id="_84858236-ab93-717c-f024-bbc737c6a49f"><tt>axis : int (default is -2)</tt> — Sequence dimension of the <tt>past_cache</tt> and <tt>update</tt> tensors. It cannot be 0 (the batch dimension). Default is -2.<br/> <tt>mode : string (default is linear)</tt> — Write mode of cache update. Supported modes include <tt>linear</tt> and <tt>circular</tt>. <tt>linear</tt> mode requires write_indices+sequence_length&lt;=max_sequence_length. For <tt>circular</tt> mode, the updates happen in wrap-around fashion, ie, the update index is modulo <tt>max_sequence_length</tt></p>
</dd>
<dt>Type constraints</dt>
<dd id="_958a9ea8-04c7-3331-7c14-d8e53f808913"><p id="_7838cb21-ac24-e6e2-4bc3-21186d73f9e8"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0)</tt> — Constrain input and output types to any tensor type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_6a6db161-0457-e35c-4e4a-ad6a2a5fe8c6"><p id="_dd768c28-faa5-21ab-5b51-2b59e0732d75"><tt>test_tensorscatter</tt>, <tt>test_tensorscatter_3d</tt>, <tt>test_tensorscatter_circular</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_cc17354e-5178-3ceb-34c0-2d44e35e73d1"><p id="_d36403aa-6c63-ab4b-e235-b13d685cdcc6">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_bf1891a5-78ca-730b-1eea-d8bdbeb0e1da" anchor="op-ai-onnx-default-tfidfvectorizer" obligation="normative">
<title id="_3f756a17-83f6-be8b-9cdd-76eb171aeac9">TfIdfVectorizer</title>
<p id="_328a6e83-a549-33c1-8528-30b964992bec">This transform extracts n-grams from the input sequence and save them as a vector. Input can be either a 1-D or 2-D tensor. For 1-D input, output is the n-gram representation of that input. For 2-D input, the output is also a  2-D tensor whose i-th row is the n-gram representation of the i-th input row. More specifically, if input shape is [C], the corresponding output shape would be [max(ngram_indexes) + 1]. If input shape is [N, C], this operator produces a [N, max(ngram_indexes) + 1]-tensor.</p>

<p id="_38f6fe81-a331-7aa4-22ad-4d8b74525549">In contrast to standard n-gram extraction, here, the indexes of extracting an n-gram from the original sequence are not necessarily consecutive numbers. The discontinuity between indexes are controlled by the number of skips. If the number of skips is 2, we should skip two tokens when scanning through the original sequence. Let’s consider an example. Assume that input sequence is [94, 17, 36, 12, 28] and the number of skips is 2. The associated 2-grams are [94, 12] and [17, 28] respectively indexed by [0, 3] and [1, 4]. If the number of skips becomes 0, the 2-grams generated are [94, 17], [17, 36], [36, 12], [12, 28] indexed by [0, 1], [1, 2], [2, 3], [3, 4], respectively.</p>

<p id="_23ecd2e2-3daa-13fc-641b-7709d5ccd6a2">The output vector (denoted by Y) stores the count of each n-gram; Y[ngram_indexes[i]] indicates the times that the i-th n-gram is found. The attribute ngram_indexes is used to determine the mapping between index i and the corresponding n-gram’s output coordinate. If pool_int64s is [94, 17, 17, 36], ngram_indexes is [1, 0], ngram_counts=[0, 0], then the Y[0] (first element in Y) and Y[1] (second element in Y) are the counts of [17, 36] and [94, 17], respectively. An n-gram which cannot be found in pool_strings/pool_int64s should be ignored and has no effect on the output. Note that we may consider all skips up to S when generating the n-grams.</p>

<p id="_9a6c8aa4-2333-3508-38ba-13e78faa8c7e">The examples used above are true if mode is “TF”. If mode is “IDF”, all the counts larger than 1 would be truncated to 1 and the i-th element in weights would be used to scale (by multiplication) the count of the i-th n-gram in pool. If mode is “TFIDF”, this operator first computes the counts of all n-grams and then scale them by the associated values in the weights attribute.</p>

<p id="_0298371d-90c1-4240-5bbf-94da142557e6">Only one of pool_strings and pool_int64s can be set. If pool_int64s is set, the input should be an integer tensor. If pool_strings is set, the input must be a string tensor.</p>

<dl id="_e03a4f35-bd2c-d503-5aa0-efccc1a37e97"><dt>Domain</dt>
<dd id="_126bc54b-0890-79a0-827e-a58a653d39b0"><p id="_d904b0c7-6002-befb-2303-8ac47f6203ba"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_aecc6d7c-709a-186e-cb5b-865182d6c7d4"><p id="_290230f2-97a5-ee54-d884-ec364c3afccc">9</p>
</dd>
<dt>Inputs</dt>
<dd id="_7bcfccb6-f2f1-69ed-3e28-4ab41525783c"><p id="_3007e6e6-a6d8-5a12-51d3-e01c75f2a9ab"><tt>X (non-differentiable) : T</tt> — Input for n-gram extraction</p>
</dd>
<dt>Outputs</dt>
<dd id="_61c1c15b-1bf6-8744-f054-49c2d0c5255c"><p id="_d5c56ec3-4c98-971d-d413-6895069798fe"><tt>Y (non-differentiable) : T1</tt> — Ngram results</p>
</dd>
<dt>Attributes</dt>
<dd id="_46c83321-ab55-75b8-aec3-5e114de73342"><p id="_6651a373-2d46-50b9-2495-f049a6c4f405"><tt>max_gram_length : int (required)</tt> — Maximum n-gram length. If this value is 3, 3-grams will be used to generate the output.<br/> <tt>max_skip_count : int (required)</tt> — Maximum number of items (integers/strings) to be skipped when constructing an n-gram from X. If max_skip_count=1, min_gram_length=2, max_gram_length=3, this operator may generate 2-grams with skip_count=0 and skip_count=1, and 3-grams with skip_count=0 and skip_count=1<br/> <tt>min_gram_length : int (required)</tt> — Minimum n-gram length. If this value is 2 and max_gram_length is 3, output may contain counts of 2-grams and 3-grams.<br/> <tt>mode : string (required)</tt> — The weighting criteria. It can be one of “TF” (term frequency), “IDF” (inverse document frequency), and “TFIDF” (the combination of TF and IDF)<br/> <tt>ngram_counts : list of ints (required)</tt> — The starting indexes of 1-grams, 2-grams, and so on in pool. It is useful when determining the boundary between two consecutive collections of n-grams. For example, if ngram_counts is [0, 17, 36], the first index (zero-based) of 1-gram/2-gram/3-gram in pool are 0/17/36. This format is essentially identical to CSR (or CSC) sparse matrix format, and we choose to use this due to its popularity.<br/> <tt>ngram_indexes : list of ints (required)</tt> — list of int64s (type: AttributeProto::INTS). This list is parallel to the specified ‘pool_*’ attribute. The i-th element in ngram_indexes indicate the coordinate of the i-th n-gram in the output tensor.<br/> <tt>pool_int64s : list of ints</tt> — List of int64 n-grams learned from the training set. Either this or pool_strings attributes must be present but not both. It’s an 1-D tensor starting with the collections of all 1-grams and ending with the collections of n-grams. The i-th element in pool stores the n-gram that should be mapped to coordinate ngram_indexes[i] in the output vector.<br/> <tt>pool_strings : list of strings</tt> — List of strings n-grams learned from the training set. Either this or pool_int64s attributes must be present but not both. It’s an 1-D tensor starting with the collections of all 1-grams and ending with the collections of n-grams. The i-th element in pool stores the n-gram that should be mapped to coordinate ngram_indexes[i] in the output vector.<br/> <tt>weights : list of floats</tt> — list of floats. This attribute stores the weight of each n-gram in pool. The i-th element in weights is the weight of the i-th n-gram in pool. Its length equals to the size of ngram_indexes. By default, weights is an all-one tensor.This attribute is used when mode is “IDF” or “TFIDF” to scale the associated word counts.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_59feebdd-ddca-9897-fff5-1fbfb8809336"><p id="_67b66974-c10a-9cfd-4a59-f647188fcfc4"><tt>T : tensor(string), tensor(int32), tensor(int64)</tt> — Input is either string UTF-8 or int32/int64<br/> <tt>T1 : tensor(float)</tt> — 1-D tensor of floats</p>
</dd>
<dt>Test vectors</dt>
<dd id="_9498f77c-8061-f822-46b0-e67a94ba51c1"><p id="_a031fbb4-939f-f6be-73ed-3ca469dfd182"><tt>test_tfidfvectorizer_tf_batch_onlybigrams_skip0</tt>, <tt>test_tfidfvectorizer_tf_batch_onlybigrams_skip5</tt>, <tt>test_tfidfvectorizer_tf_batch_uniandbigrams_skip5</tt>, <tt>test_tfidfvectorizer_tf_only_bigrams_skip0</tt>, <tt>test_tfidfvectorizer_tf_onlybigrams_levelempty</tt>, <tt>test_tfidfvectorizer_tf_onlybigrams_skip5</tt>, <tt>test_tfidfvectorizer_tf_uniandbigrams_skip5</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_e3e66c96-d1c1-f601-29eb-9e9916a1af2c"><p id="_acd022fd-d33f-34f7-6f08-bc747f7e14b4">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_2b7d7497-c3e3-8cf0-0de6-a55ac2b07178" anchor="op-ai-onnx-default-thresholdedrelu" obligation="normative">
<title id="_373d8ba2-06a2-225d-9ea5-a09d66ddf90b">ThresholdedRelu</title>
<p id="_6cbd9a0e-71e1-3f0d-2eaa-33865f114414">ThresholdedRelu takes one input data (<tt>Tensor&lt;T&gt;</tt>) and produces one output data (<tt>Tensor&lt;T&gt;</tt>) where the rectified linear function, y = x for x &gt; alpha, y = 0 otherwise, is applied to the tensor elementwise.</p>

<dl id="_f099f5f8-57bc-2b06-2fc9-84966405fb96"><dt>Domain</dt>
<dd id="_c0150532-6a9f-7ee5-803e-89909adac517"><p id="_7d8bf649-8e12-848a-fa97-06776b544bdb"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_8352440d-617f-a18f-150c-c5d5597acb9b"><p id="_938dad8d-5826-17cf-d609-66a026971c52">22</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_dc43f24c-51dd-c2d4-e8c6-ca820f938882"><p id="_29d500b3-21d6-9453-09be-9617ce5c989e">10</p>
</dd>
<dt>Inputs</dt>
<dd id="_a59c9650-93c4-6d17-f6b8-a35e8c61590b"><p id="_7ee91405-fbd2-8fe3-9527-c110bd52fddd"><tt>X (differentiable) : T</tt> — Input tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_67a789bd-a435-ed0b-f15a-b0a5c7f2ffa9"><p id="_6fb104ad-78c6-72dc-1e87-1a3f36e748b1"><tt>Y (differentiable) : T</tt> — Output tensor</p>
</dd>
<dt>Attributes</dt>
<dd id="_b590ac27-b840-5c19-6014-0e2c6889aa82"><p id="_fd0ef0e3-0b99-3fb8-29d7-6178cd9e5172"><tt>alpha : float (default is 1.0)</tt> — Threshold value</p>
</dd>
<dt>Type constraints</dt>
<dd id="_4e142e0c-33f3-80ea-3976-9cc399a5fcf7"><p id="_dcaf509d-88a7-f221-bb6c-e1baf5a8ea6a"><tt>T : tensor(bfloat16), tensor(float16), tensor(float), tensor(double)</tt> — Constrain input and output types to float tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_3e38a6c3-2d03-9df5-3752-90d1cb72954f"><p id="_93c770a0-5c38-76e4-2a50-4714d092ddcc"><tt>test_thresholdedrelu_default</tt>, <tt>test_thresholdedrelu_example</tt>, <tt>test_thresholdedrelu</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_3c355ea9-77a7-7c5f-9cd9-3049ddae215d"><p id="_a9ee56c7-8909-4112-ea27-733d3e8e8319">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_032b5b3d-065f-4223-219a-098e6d580fb4" anchor="op-ai-onnx-default-tile" obligation="normative">
<title id="_6218f35f-225a-182f-4bd6-57853ced91cd">Tile</title>
<p id="_505e176a-550b-872e-fdf7-35bbcea4fd70">Constructs a tensor by tiling a given tensor. This is the same as function  <tt>tile</tt> in Numpy, but no broadcast. For example A = [[1, 2], [3, 4]], B = [1, 2], tile(A, B) = [[1, 2, 1, 2], [3, 4, 3, 4]]</p>

<dl id="_d63e96ae-d04a-c022-cd95-3f6710f036ee"><dt>Domain</dt>
<dd id="_79c130cc-16ad-481a-da06-92f8ace26f08"><p id="_33bd0904-8061-aead-33fd-08102b97d5ae"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_9ba64a2e-fe55-3ddf-7bfd-0c0627043b4c"><p id="_c7210e91-ace1-4bd3-77ba-47c3b1b93b37">13</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_7cc5b874-29d6-2e60-ae49-335e963033ac"><p id="_e2be4fe2-d63f-ffce-9ee1-26ff53365ad4">1, 6</p>
</dd>
<dt>Inputs</dt>
<dd id="_ec1d55a9-2ca4-8d29-0e81-f40c625cd603"><p id="_ee78b87e-27d7-6643-3de4-b61a4754bd6b"><tt>input (differentiable) : T</tt> — Input tensor of any shape.<br/> <tt>repeats (non-differentiable) : T1</tt> — 1D int64 tensor of the same length as input’s dimension number, includes numbers of repeated copies along input’s dimensions.</p>
</dd>
<dt>Outputs</dt>
<dd id="_d91e66ad-157b-f803-2bb3-cd92a99ed8eb"><p id="_0dafdceb-0364-f9a1-648d-7237eb64a723"><tt>output (differentiable) : T</tt> — Output tensor of the same dimensions and type as tensor input. output_dim[i] = input_dim[i] * repeats[i]</p>
</dd>
<dt>Attributes</dt>
<dd id="_ebbea50b-23f8-70bc-6d22-7d93cf0b2d0f"><p id="_8cfba2e1-c5c7-a23a-d611-48da43746709">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_05548b4a-eca6-166a-e151-cdf15e45d9af"><p id="_779239f9-1b42-18fe-d492-e8b161cbf1ee"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input and output types to all tensor types.<br/> <tt>T1 : tensor(int64)</tt> — Constrain repeat’s type to int64 tensors.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_efb000f7-63a9-4b73-a21c-95d44879ac72"><p id="_cca0010e-bcb2-8f91-fb4f-f0698ecd21ff"><tt>test_tile</tt>, <tt>test_tile_precomputed</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_bec78ee8-01bd-76ee-693f-f1a160eeb0ba"><p id="_c9425168-4acb-8629-24d8-3b11f1dcfe17">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_88b51a8c-6f56-c2c3-7af5-9f9cddf483ed" anchor="op-ai-onnx-default-topk" obligation="normative">
<title id="_4f71578a-440a-9f24-1958-68e9ef1fe2de">TopK</title>
<p id="_27deea57-1799-62e4-53bb-7dbb7160963d">Retrieve the top-K largest or smallest elements along a specified axis. Given an input tensor of shape [a_0, a_1, …​, a_{n-1}] and integer argument k, return two outputs:</p>

<ul id="_d8ace956-e815-3139-981a-fea006dbbddd"><li><p id="_5e908707-c1d4-adbb-8d27-b9e18c7bb476">Value tensor of shape [a_0, a_1, …​, a_{axis-1}, k, a_{axis+1}, …​ a_{n-1}] which contains the values of the top k elements along the specified axis</p>
</li>
<li><p id="_5c0ef801-8ddd-00ec-9da8-1e601ab8169d">Index tensor of shape [a_0, a_1, …​, a_{axis-1}, k, a_{axis+1}, …​ a_{n-1}] which contains the indices of the top k elements (original indices from the input tensor).</p>
</li>
<li><p id="_33d50cf7-cb2b-af16-aff6-8e86e5cfd584">If “largest” is 1 (the default value) then the k largest elements are returned.</p>
</li>
<li><p id="_55d5e064-49b2-c5ad-cdd1-c8754192f3f2">If “sorted” is 1 (the default value) then the resulting k elements will be sorted.</p>
</li>
<li><p id="_3ad39c1a-8a53-3016-6b71-55edaa1a1e33">If “sorted” is 0, order of returned ‘Values’ and ‘Indices’ are undefined.</p>
</li>
</ul>

<p id="_0982a034-c107-75f4-7de8-38864658a1d1">Given two equivalent values, this operator uses the indices along the axis as a tiebreaker. That is, the element with the lower index will appear first.</p>

<dl id="_7bc993a1-74d1-ceef-123c-31ec032ea3bf"><dt>Domain</dt>
<dd id="_874c597f-e00d-6815-1c8e-fd39138e7586"><p id="_a55f4070-4245-8f4d-58a9-6b3e86aeb817"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_89ea6fc6-e48f-77a5-e495-971865a3ecd1"><p id="_cd80c450-639e-0d7a-ab01-045ea61a33ba">24</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_43725a36-b83d-00ee-451a-d572ff78f663"><p id="_709b58a3-a251-b9ec-a502-217ade6e5a8b">1, 10, 11</p>
</dd>
<dt>Inputs</dt>
<dd id="_c4713465-ba23-f3fc-bf86-f7e4513f2c63"><p id="_6c22790a-76b5-5919-d6c5-101f25e22785"><tt>X (differentiable) : T</tt> — Tensor of shape [a_0, a_1, …​, a_{n-1}]<br/> <tt>K (non-differentiable) : tensor(int64)</tt> — A 1-D tensor containing a single positive value corresponding to the number of top elements to retrieve</p>
</dd>
<dt>Outputs</dt>
<dd id="_9a2d9a27-8a92-a4ac-c382-38cdf80f9fc4"><p id="_824f6fcc-4028-07fc-3b02-2237c82d5945"><tt>Values (differentiable) : T</tt> — Tensor of shape [a_0, a_1, …​, a_{axis-1}, k, a_{axis+1}, …​ a_{n-1}] containing top K values from the input tensor<br/> <tt>Indices (non-differentiable) : I</tt> — Tensor of shape [a_0, a_1, …​, a_{axis-1}, k, a_{axis+1}, …​ a_{n-1}] containing the corresponding input tensor indices for the top K values.</p>
</dd>
<dt>Attributes</dt>
<dd id="_4a2d6e45-741c-fad8-5ffc-2afb6e51be26"><p id="_4eea9309-f028-45df-54cb-bb98b039f11b"><tt>axis : int (default is -1)</tt> — Dimension on which to do the sort. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(input).<br/> <tt>largest : int (default is 1)</tt> — Whether to return the top-K largest or smallest elements.<br/> <tt>sorted : int (default is 1)</tt> — Whether to return the elements in sorted order.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_529a2398-58a0-df0e-d096-b994f924fc18"><p id="_4b985801-88b2-73d4-9429-8383d5e12007"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)</tt> — Constrain input and output types to numeric tensors.<br/> <tt>I : tensor(int64)</tt> — Constrain index tensor to int64</p>
</dd>
<dt>Test vectors</dt>
<dd id="_82c0aa3a-fcbd-93d1-b180-e6f3dc73cb84"><p id="_5b7b2b34-7108-5b14-c333-9a8df0c9882f"><tt>test_top_k</tt>, <tt>test_top_k_negative_axis</tt>, <tt>test_top_k_same_values</tt>, <tt>test_top_k_same_values_2d</tt>, <tt>test_top_k_same_values_largest</tt>, <tt>test_top_k_smallest</tt>, <tt>test_top_k_uint64</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_29214dd6-dc22-8778-7526-bcda6d02405f"><p id="_b184038e-d7d5-1c58-ad38-aede9a30135d">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_7f04db96-ef70-0e15-395a-fc6ec09f6992" anchor="op-ai-onnx-default-transpose" obligation="normative">
<title id="_8d3ce425-00e4-88c1-b511-c0ccbbc57ef9">Transpose</title>
<p id="_0a0f46ea-485a-c7f0-4aa9-30a5d1c4323c">Returns a transpose of the input tensor. (Similar to <tt>numpy.transpose</tt>). The optional attribute  <tt>perm</tt> specifies the permutation of the axes of the input tensor.  <tt>perm</tt> must contain each axis index in <tt>[0, n-1]</tt> exactly once, so its length is equal to the rank  <tt>n</tt> of the input tensor.</p>

<p id="_7f969d8e-e02c-7fad-19c9-6c13001cbf39">Axis <tt>i</tt> of the output tensor corresponds to axis <tt>perm[i]</tt> of the input tensor.</p>

<p id="_ed8754d6-096f-279e-8dab-305f461a44d3">If the attribute is omitted, its default value is <tt>(n-1, ..., 0)</tt>, where <tt>n</tt> is the rank of the input tensor (that is, the dimensions are reversed).</p>

<p id="_4be86cfe-201b-39ef-f379-f8a479a0c099">For example, when perm=(1, 0, 2), given an input tensor of shape (1, 2, 3), the output shape will be (2, 1, 3). When perm=(1, 2, 0), given an input tensor of shape (1, 2, 3), the output shape will be (2, 3, 1). A 0-D or 1-D input is valid; in those cases the output has the same shape as the input.</p>

<dl id="_03138b02-95ee-7e64-910a-cf24bdcdb25a"><dt>Domain</dt>
<dd id="_1d917e9f-e0a5-1dd2-c7fb-c066456355be"><p id="_1fe7a7e6-2577-2cd0-48e0-38189711df07"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_f31231a9-4804-3024-2644-62ae5035624a"><p id="_015c2cb2-c058-4ec6-9383-2901a3d7f237">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_22c1429d-bf2a-6cf1-e96c-a0dd7bf067dd"><p id="_67af70fb-6d91-9fe6-7b4d-555fa9ac593e">1, 13, 21, 23, 24</p>
</dd>
<dt>Inputs</dt>
<dd id="_0610bc23-d952-c40d-8bf4-54bb597dca72"><p id="_4d72deb5-45d1-c169-9e05-2c9b5e403a71"><tt>data (differentiable) : T</tt> — An input tensor.</p>
</dd>
<dt>Outputs</dt>
<dd id="_f162ee43-d9e2-1f29-903d-47a24ebc52c4"><p id="_6c7d501a-9eb8-a23a-df03-371d22dddd92"><tt>transposed (differentiable) : T</tt> — Transposed output.</p>
</dd>
<dt>Attributes</dt>
<dd id="_ac32b0bc-bc1c-360e-c63b-632b715dee67"><p id="_1db52316-a391-cbd1-9704-a7f73055b56b"><tt>perm : list of ints</tt> — A list of integers. By default, reverse the dimensions; otherwise permute the axes according to the values given. Its length must be equal to the rank of the input, and each value must be in the range <tt>[0, rank-1]</tt>.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_12b34332-81aa-84df-0dac-f5925b2d469d"><p id="_c5804ebd-4624-79cd-39bd-2dde29ac33fb"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2)</tt> — Constrain input and output types to all tensor types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_e86ebd6c-c1fa-d3c4-a280-5349698d4fa5"><p id="_11164f09-06cc-484d-072a-0ed220b0e78f"><tt>test_transpose_default</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_a51e0eee-1d41-8a6a-e9e2-77957027f8ad"><p id="_1cd34ef1-0373-8d18-901e-e8947fd43e4c">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_9a20b0bd-d7e4-df8d-ee12-464474457826" anchor="op-ai-onnx-default-trilu" obligation="normative">
<title id="_b6d80025-ae7e-845a-ad98-b09b89ce94a2">Trilu</title>
<p id="_812995ab-4564-4bdd-0fae-0ffa9a410b3c">Given a 2-D matrix or batches of 2-D matrices, returns the upper or lower triangular part of the tensor(s). The attribute “upper” determines whether the upper or lower part is retained. If set to true, the upper triangular matrix is retained. Lower triangular matrix is retained otherwise. Default value for the “upper” attribute is true. Trilu takes one input tensor of shape [*, N, M], where * is zero or more batch dimensions. The upper triangular part consists of the elements on and above the given diagonal (k). The lower triangular part consists of elements on and below the diagonal. All other elements in the matrix are set to zero. If k = 0, the triangular part on and above/below the main diagonal is retained. If upper is set to true, a positive k retains the upper triangular matrix excluding the main diagonal and (k-1) diagonals above it. A negative k value retains the main diagonal and |k| diagonals below it. If upper is set to false, a positive k retains the lower triangular matrix including the main diagonal and k diagonals above it. A negative k value excludes the main diagonal and (|k|-1) diagonals below it.</p>

<dl id="_28c53b0e-fc3f-31e7-06b0-76a2827b8eaf"><dt>Domain</dt>
<dd id="_dd585497-27c8-ef09-9dfb-2b11f03cb21b"><p id="_2150c33f-e8cc-1887-b90c-f11f9735bc41"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_b259f51e-3738-cce9-0764-7de22f6711e1"><p id="_3bb7e1eb-9657-2987-8564-1e24f70e92d9">14</p>
</dd>
<dt>Inputs (1 — 2)</dt>
<dd id="_50b2e6bc-9bb5-4d6c-73f7-5f741bb899fd"><p id="_250186fa-01fe-d8f9-bfed-e0be289e271a"><tt>input (differentiable) : T</tt> — Input tensor of rank 2 or higher.<br/> <tt>k (optional, non-differentiable) : tensor(int64)</tt> — A 0-D tensor containing a single value corresponding to the number diagonals above or below the main diagonal to exclude or include. Default value is 0 if it’s not specified.</p>
</dd>
<dt>Outputs</dt>
<dd id="_47c33ba7-bf28-06f5-488e-2d0097fb4632"><p id="_1afdd7ad-c99f-eda7-137b-19138160cf10"><tt>output (differentiable) : T</tt> — Output tensor of the same type and shape as the input tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_cd3d7a98-728f-9deb-6722-be0c2fd8c44f"><p id="_2e835b55-b847-9122-fe53-a9c88f3a5583"><tt>upper : int (default is 1)</tt> — Boolean. Indicates whether upper or lower part of matrix is retained. Default is true.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_48b567fb-6705-df3c-290a-c271d1cd3b02"><p id="_6ddb6397-0339-b8b7-fb9b-d1260b515f2d"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input and output types to all tensor types.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_48521835-0387-bd31-6230-13865d16fb7e"><p id="_c11f7d19-7904-d125-4cd7-cc31cd25fcb3"><tt>test_tril</tt>, <tt>test_tril_neg</tt>, <tt>test_tril_one_row_neg</tt>, <tt>test_tril_out_neg</tt>, <tt>test_tril_out_pos</tt>, <tt>test_tril_pos</tt>, <tt>test_tril_square</tt>, <tt>test_tril_square_neg</tt>, <tt>test_tril_zero</tt>, <tt>test_triu</tt>, <tt>test_triu_neg</tt>, <tt>test_triu_one_row</tt>, <tt>test_triu_out_neg_out</tt>, <tt>test_triu_out_pos</tt>, <tt>test_triu_pos</tt>, <tt>test_triu_square</tt>, <tt>test_triu_square_neg</tt>, <tt>test_triu_zero</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_0e9c8b64-6bfd-6e3e-01fb-44788b3a7b4c"><p id="_5ee09a9e-aa53-72ff-9871-ac3ca014cee7">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_c9b55d9e-dcf5-61bf-0b2d-ba644063d2b6" anchor="op-ai-onnx-default-unique" obligation="normative">
<title id="_7a521b16-7861-5c98-5174-d010999c018f">Unique</title>
<p id="_0a11f70d-d934-ec9b-9fce-92e29d9feb7b">Find the unique elements of a tensor. When an optional attribute ‘axis’ is provided, unique subtensors sliced along the ‘axis’ are returned. Otherwise the input tensor is flattened and unique values of the flattened tensor are returned.</p>

<p id="_21d115df-1fb4-276e-962f-2c1575e99593">This operator returns the unique values or sliced unique subtensors of the input tensor and three optional outputs. The first output tensor ‘Y’ contains all unique values or subtensors of the input. The second optional output tensor ‘indices’ contains indices of ‘Y’ elements’ first occurrence in ‘X’. The third optional output tensor ‘inverse_indices’ contains, for elements of ‘X’, its corresponding indices in ‘Y’. The fourth optional output tensor ‘counts’ contains the count of each element of ‘Y’ in the input.</p>

<p id="_e00f53ff-3813-9789-fbdc-6f4262db5130">Outputs are either sorted in ascending order or optionally in the order of the first occurrence of the values in the input.</p>

<p id="_9f00d486-c624-fb62-120c-496862abdc6c"><link target="https://docs.scipy.org/doc/numpy/reference/generated/numpy.unique.html"/></p>

<p id="_de56f6b4-f318-42e7-b3f7-55d061047b17">Example 1:</p>

<sourcecode id="_1964ccb9-96dd-0bb0-cd1d-50025de4a62d" unnumbered="true"><body>input_X = [2, 1, 1, 3, 4, 3]
attribute_sorted = 0
attribute_axis = None
output_Y = [2, 1, 3, 4]
output_indices = [0, 1, 3, 4]
output_inverse_indices = [0, 1, 1, 2, 3, 2]
output_counts = [1, 2, 2, 1]</body></sourcecode>


<p id="_0bd7f285-86be-0195-b9c5-b0e5e50fd8ed">Example 2:</p>

<sourcecode id="_2258d097-c1a6-128a-ca64-3d0e8b7c8ec6" unnumbered="true"><body>input_X = [[1, 3], [2, 3]]
attribute_sorted = 1
attribute_axis = None
output_Y = [1, 2, 3]
output_indices = [0, 2, 1]
output_inverse_indices = [0, 2, 1, 2]
output_counts = [1, 1, 2]</body></sourcecode>


<p id="_ffada141-dd07-6afa-c8ac-784922360281">Example 3:</p>

<sourcecode id="_21e5b3a3-8a79-4c36-3c52-8a0a87cef518" unnumbered="true"><body>input_X = [[1, 0, 0], [1, 0, 0], [2, 3, 4]]
attribute_sorted = 1
attribute_axis = 0
output_Y = [[1, 0, 0], [2, 3, 4]]
output_indices = [0, 2]
output_inverse_indices = [0, 0, 1]
output_counts = [2, 1]</body></sourcecode>


<p id="_2bd73d50-933a-82c6-5b2c-f9c2e64d53dd">Example 4:</p>

<sourcecode id="_8b071909-df82-f07a-823b-b2a7ae930b2e" unnumbered="true"><body>input_x = [[[1., 1.], [0., 1.], [2., 1.], [0., 1.]],
            [[1., 1.], [0., 1.], [2., 1.], [0., 1.]]]
attribute_sorted = 1
attribute_axis = 1</body></sourcecode>


<p id="_b6b3b38c-d998-7e6f-9ddc-893b2dd82181">intermediate data are presented below for better understanding: there are 4 subtensors sliced along axis 1 of input_x (shape = (2, 4, 2)):</p>

<sourcecode id="_b089893e-6b04-5613-0b48-0b5c58799fde" unnumbered="true"><body>A: [[1, 1], [1, 1]],
   [[0, 1], [0, 1]],
   [[2, 1], [2, 1]],
   [[0, 1], [0, 1]].</body></sourcecode>


<p id="_898f3e62-168b-f00e-6ce0-f4fcb10baaf1">there are 3 unique subtensors:</p>

<sourcecode id="_f6a9d6b4-8a30-c610-406f-379897bf0159" unnumbered="true"><body>[[1, 1], [1, 1]],
[[0, 1], [0, 1]],
[[2, 1], [2, 1]].</body></sourcecode>


<p id="_926963dd-f6bc-6e2a-0890-b6b6f97db299">sorted unique subtensors:</p>

<sourcecode id="_f6860eaa-4ed7-f748-0224-e6765c64dea3" unnumbered="true"><body>B: [[0, 1], [0, 1]],
   [[1, 1], [1, 1]],
   [[2, 1], [2, 1]].</body></sourcecode>


<p id="_a2daac7b-ea81-351e-9f52-ee72eeb114e9">output_Y is constructed from B:</p>

<sourcecode id="_c8fb5e38-dd60-3f84-55fc-40e04195ca77" unnumbered="true"><body>[[[0. 1.], [1. 1.], [2. 1.]],
 [[0. 1.], [1. 1.], [2. 1.]]]</body></sourcecode>


<p id="_2cad8b6f-0da3-de2f-9051-379f20fb3098">output_indices is to map from B to A:</p>

<sourcecode id="_d42f379f-0455-6e81-8041-d6a540098fa0" unnumbered="true"><body>[1, 0, 2]</body></sourcecode>


<p id="_b2a1bfa3-5e21-31d1-5c37-8773ec32c102">output_inverse_indices is to map from A to B:</p>

<sourcecode id="_f7a56386-671e-e8b3-013c-092d5eaf84b7" unnumbered="true"><body>[1, 0, 2, 0]</body></sourcecode>


<p id="_cdb167d2-864d-e6a6-26bb-b185d1a5335c">output_counts:</p>

<sourcecode id="_d8777eb9-8232-4b55-f442-1d7253ad2cbe" unnumbered="true"><body>[2, 1, 1]</body></sourcecode>


<dl id="_e8dda0c2-4f55-dbe1-06b8-d2cad706f0e2"><dt>Domain</dt>
<dd id="_bbf0e10a-5ce8-654e-f679-b78d453fa2fc"><p id="_346f7315-0be3-4c44-09c2-ba68bef2759c"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_7094aab3-3244-fd74-d31a-1a11c9142783"><p id="_318cdf30-15de-3ab0-ee1b-824a0330ba3e">28</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_f55450aa-8374-518d-a7ee-4793ea9cd846"><p id="_32fdbe01-c93b-b2cc-db40-ccbfbcfa8855">11</p>
</dd>
<dt>Inputs</dt>
<dd id="_9f3495e2-5e7c-0f85-ddec-735855d1291a"><p id="_59378246-94e4-858e-5a7d-f039d3d63f15"><tt>X (non-differentiable) : T</tt> — A N-D input tensor that is to be processed.</p>
</dd>
<dt>Outputs (1 — 4)</dt>
<dd id="_4b0af615-48fd-240d-81cb-9fe250e3ff0f"><p id="_1c4bb718-0f2a-bec0-6263-2bd920fcbd3a"><tt>Y (non-differentiable) : T</tt> — A tensor of the same type as ‘X’ containing all the unique values or subtensors sliced along a provided ‘axis’ in ‘X’, either sorted or maintained in the same order they occur in input ‘X’<br/> <tt>indices (optional, non-differentiable) : tensor(int64)</tt> — A 1-D INT64 tensor containing indices of ‘Y’ elements’ first occurrence in ‘X’. When ‘axis’ is provided, it contains indices to subtensors in input ‘X’ on the ‘axis’. When ‘axis’ is not provided, it contains indices to values in the flattened input tensor.<br/> <tt>inverse_indices (optional, non-differentiable) : tensor(int64)</tt> — A 1-D INT64 tensor containing, for elements of ‘X’, its corresponding indices in ‘Y’. When ‘axis’ is provided, it contains indices to subtensors in output ‘Y’ on the ‘axis’. When ‘axis’ is not provided, it contains indices to values in output ‘Y’.<br/> <tt>counts (optional, non-differentiable) : tensor(int64)</tt> — A 1-D INT64 tensor containing the count of each element of ‘Y’ in input ‘X’</p>
</dd>
<dt>Attributes</dt>
<dd id="_59aa5a18-3623-a897-9322-154e98765a90"><p id="_c567011e-4fef-4e25-f07b-a2535360724e"><tt>axis : int</tt> — (Optional) The dimension to apply unique. If not specified, the unique elements of the flattened input are returned. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(input).<br/> <tt>sorted : int (default is 1)</tt> — (Optional) Whether to sort the unique elements in ascending order before returning as output. Must be one of 0, or 1 (default).</p>
</dd>
<dt>Type constraints</dt>
<dd id="_05d23b76-5eaa-9cb9-4538-fd8d5d56b0fa"><p id="_37773e4f-dd3f-646b-5e0d-09c80e893c7e"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Input can be of any tensor type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_fb4ccd69-c80e-ad4a-2ce4-77d9e034516d"><p id="_8f851f33-688c-7618-4063-97ed07dda5e1"><tt>test_unique_length_1</tt>, <tt>test_unique_not_sorted_without_axis</tt>, <tt>test_unique_sorted_with_axis</tt>, <tt>test_unique_sorted_with_axis_3d</tt>, <tt>test_unique_sorted_with_negative_axis</tt>, <tt>test_unique_sorted_without_axis</tt>, <tt>test_unique_bfloat16_sorted_without_axis</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_35818720-51ed-d244-d1ed-5e858404fe9b"><p id="_9157cece-a0c9-21c0-4d10-8d051c797f67">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_65faa7f1-421f-c9ae-2e04-fc74d9dd9d25" anchor="op-ai-onnx-default-unsqueeze" obligation="normative">
<title id="_68665c12-0e75-2f95-c9b3-317c358c37b2">Unsqueeze</title>
<p id="_70d676ae-80c8-9c93-2e00-8b0d6080feeb">Insert single-dimensional entries to the shape of an input tensor (<tt>data</tt>). Takes one required input  <tt>axes</tt> — which contains a list of dimension indices and this operator will insert a dimension of value <tt>1</tt> into the corresponding index of the output tensor (<tt>expanded</tt>).</p>

<p id="_19dfdf36-7fab-26fc-44a2-19bd554b0f23">For example, given an input tensor (<tt>data</tt>) of shape [3, 4, 5], then Unsqueeze(data, axes=[0, 4]) outputs a tensor (<tt>expanded</tt>) containing same data as <tt>data</tt> but with shape [1, 3, 4, 5, 1].</p>

<p id="_08c0c451-16d4-46be-e634-8c65f8925ef5">The input <tt>axes</tt> should not contain any duplicate entries. It is an error if it contains duplicates. The rank of the output tensor (<tt>output_rank</tt>) is the rank of the input tensor (<tt>data</tt>) plus the number of values in <tt>axes</tt>. Each value in  <tt>axes</tt> should be within the (inclusive) range [-output_rank , output_rank — 1]. The order of values in  <tt>axes</tt> does not matter and can come in any order.</p>

<dl id="_478a45ae-c4e1-eb9b-9895-f3be04149c7b"><dt>Domain</dt>
<dd id="_23c7af0e-5daa-0116-12bb-e74e6471fd40"><p id="_4137b00a-ee7d-af3c-427a-e2f8f238bb19"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_178106a6-a315-aa0f-c083-3d4880fbf654"><p id="_0bc8f70c-fbcc-c29e-4cc5-983c3b24a90f">25</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_9acd3a6f-a997-179d-cc55-9fffe8d99d22"><p id="_2dfd80c2-3d27-5d7e-c85b-be1122a6c676">1, 11, 13, 21, 23, 24</p>
</dd>
<dt>Inputs</dt>
<dd id="_73cdf2a6-9fdb-81d2-4041-67e213355d6b"><p id="_500157c9-be42-2d64-cbe5-92c15f24f11d"><tt>data (differentiable) : T</tt> — Original tensor<br/> <tt>axes (non-differentiable) : tensor(int64)</tt> — 1D tensor of integers indicating the dimensions to be inserted. Negative value means counting dimensions from the back. Accepted range is [-r, r-1] where r = rank(expanded).</p>
</dd>
<dt>Outputs</dt>
<dd id="_c219c20d-adb5-58c1-e61f-f3031415c112"><p id="_d89f288c-dffc-5487-625d-cf207c72ffab"><tt>expanded (differentiable) : T</tt> — Reshaped tensor with same data as input.</p>
</dd>
<dt>Attributes</dt>
<dd id="_d7af5efb-3f9e-17cb-bae1-6101b23e17ff"><p id="_d6fea1d5-7501-349d-0791-ce1a7e751d52">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_d3438375-ca50-7e7b-19f6-a48aee7843c0"><p id="_286fdc9c-2b86-c108-9ad8-01024d2d46d7"><tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128), tensor(float8e4m3fn), tensor(float8e4m3fnuz), tensor(float8e5m2), tensor(float8e5m2fnuz), tensor(uint4), tensor(int4), tensor(float4e2m1), tensor(float8e8m0), tensor(uint2), tensor(int2)</tt> — Constrain input and output types to all tensor types up to IRv13.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_e56ebb4a-cea5-374a-0231-502476dc42fa"><p id="_1cd56f99-525f-e184-9f61-48b047c5f0f1"><tt>test_unsqueeze_negative_axes</tt>, <tt>test_unsqueeze_axis_</tt>, <tt>test_unsqueeze_three_axes</tt>, <tt>test_unsqueeze_two_axes</tt>, <tt>test_unsqueeze_unsorted_axes</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_228053cc-ce17-014b-1fa6-8e2d76fa9e7b"><p id="_638a5baa-30b7-3ccd-4cd4-d17bdcf15629">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_de70fe9f-9922-354b-13ee-9e544fb0cd39" anchor="op-ai-onnx-default-upsample" obligation="normative">
<title id="_566a6e89-4d21-8f8f-94f7-7359a3c1002a">Upsample</title>
<p id="_c45a8658-e433-2565-03a9-e18db539c38b">Upsample the input tensor. Each dimension value of the output tensor is:   output_dimension = floor(input_dimension * scale).</p>

<dl id="_e4bf9389-ac37-8684-0a2f-bdfed898febc"><dt>Domain</dt>
<dd id="_6d6416f5-ca5f-4d11-cb4f-04b53460a442"><p id="_2978f7be-5703-6c89-6409-5a95f4a11ec6"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_6a221fda-01a6-f46a-daae-a66891a6f219"><p id="_8d682e95-4c96-1778-302d-32e4b9cee141">10</p>
</dd>
<dt>Status</dt>
<dd id="_e5d2286a-826c-ec4b-56d5-392019e6f3de"><p id="_083e5d93-dbf1-7ccd-3d27-975db0774cbb">Deprecated. Clause 14.5 of <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/> applies: a deprecated operator is not removed, and a consumer continues to evaluate it.</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_8978f0d7-9ae3-61b2-4b48-8d5d11cca23f"><p id="_b2fa5f32-d59f-dfcb-b914-f8f7f69e0590">7, 9</p>
</dd>
<dt>Inputs</dt>
<dd id="_34bfd1e3-a683-cf09-f973-80e4c305d6b2"><p id="_655cafe4-4ad7-d359-1541-a33e13634090">Not stated by the source.</p>
</dd>
<dt>Outputs</dt>
<dd id="_4e4053ac-8291-9794-80e7-754410ba9c09"><p id="_265e4d04-8214-f42f-33a0-dac4b65a837f">Not stated by the source.</p>
</dd>
<dt>Attributes</dt>
<dd id="_0db81c80-048b-600d-3c66-c14378e09fed"><p id="_c26a89cf-7ded-f322-6a32-abdd7edad231">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_3895e373-2758-a9b2-287b-6b04a94cda1b"><p id="_0a1d676d-c979-7dbf-26d6-afded63442a7">Not stated by the source.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_aa6eab80-71b1-bddb-d379-d0a743547f5b"><p id="_25cb0cc4-68b4-a4e1-d435-16dfe5a92814"><tt>test_upsample_nearest</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_19213025-7793-17aa-af75-fe6f5503af1a"><p id="_a5f9fa6f-4381-7ed1-6b8c-e9023caa7faf">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_2107bad9-54a4-0817-2973-41de5cb08c96" anchor="op-ai-onnx-default-where" obligation="normative">
<title id="_0f9ae0f9-433a-aeb7-d7da-7afdf6c09dbe">Where</title>
<p id="_d9974793-9397-4a77-4b2d-18bba8af2d56">Return elements, either from X or Y, depending on condition. Where behaves like <link target="https://docs.scipy.org/doc/numpy/reference/generated/numpy.where.html">numpy.where</link> with three parameters.</p>

<p id="_ec4d2716-d73d-bd82-0e41-8c83f8f0286f">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_06220759-6458-a7a7-8287-812db10abcf9"><dt>Domain</dt>
<dd id="_fab7522e-063e-866b-2d2d-d83998824e30"><p id="_a908270b-51f1-f8a7-9f3d-b21580faa4a7"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_a07677e1-c31c-1aff-c6c2-13f3dea769aa"><p id="_e916f66c-e032-2d80-2920-11e3e2d94238">16</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_3c795dee-04d5-c426-3f28-4484ad0a0ff0"><p id="_9f4140eb-6a6a-ec84-a2fb-db3722dfb5b3">9</p>
</dd>
<dt>Inputs</dt>
<dd id="_d722552c-ea2f-6250-6786-29bac3f933be"><p id="_bb7d78a6-6ebb-333b-db66-640185cf7656"><tt>condition (non-differentiable) : B</tt> — When True (nonzero), yield X, otherwise yield Y<br/> <tt>X (differentiable) : T</tt> — values selected at indices where condition is True<br/> <tt>Y (differentiable) : T</tt> — values selected at indices where condition is False</p>
</dd>
<dt>Outputs</dt>
<dd id="_77406973-cdf4-3cf9-3e72-a6f98b04d7d8"><p id="_bfef23c7-34d6-f77b-a86c-adb9a8d98109"><tt>output (differentiable) : T</tt> — Tensor of shape equal to the broadcasted shape of condition, X, and Y.</p>
</dd>
<dt>Attributes</dt>
<dd id="_95988e99-416f-34e8-40d4-afcb1e9f9068"><p id="_d64dc23e-b121-c08d-0033-a175f3ebc027">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_6e38eb3b-b502-48db-44fd-94fe0be8b201"><p id="_e7ef48a6-d677-1a3a-eb5c-57bf058864de"><tt>B : tensor(bool)</tt> — Constrain to boolean tensors.<br/> <tt>T : tensor(uint8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(int8), tensor(int16), tensor(int32), tensor(int64), tensor(bfloat16), tensor(float16), tensor(float), tensor(double), tensor(string), tensor(bool), tensor(complex64), tensor(complex128)</tt> — Constrain input and output types to all tensor types (including bfloat).</p>
</dd>
<dt>Test vectors</dt>
<dd id="_e6a410b0-64da-58b1-1f64-5320bea6322e"><p id="_14083438-0dc8-012e-f6b3-58c459c537da"><tt>test_where_long_example</tt>, <tt>test_where_example</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_ab13431a-3cb0-b1cb-3935-c3d86f785091"><p id="_4c94ff65-5696-9b1b-c0e4-342c337b07c5">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_abdfe1a1-f93d-3bf4-5ae1-64e3dffddb92" anchor="op-ai-onnx-default-xor" obligation="normative">
<title id="_14e796c4-2290-6fbb-d773-63c385a91d7e">Xor</title>
<p id="_95073de7-0a13-36ee-7236-2455deae1f82">Returns the tensor resulted from performing the <tt>xor</tt> logical operation elementwise on the input tensors  <tt>A</tt> and <tt>B</tt> (with Numpy-style broadcasting support).</p>

<p id="_64cb088f-9b02-7a5e-25b8-2fcbe9c6f50b">This operator supports <strong>multidirectional (i.e., Numpy-style) broadcasting</strong>; for more details please check the doc.</p>

<dl id="_2d458ad6-26ba-b984-0679-b698a5b92dbd"><dt>Domain</dt>
<dd id="_c97d051a-e159-f2cd-b2d3-c59dd5de8891"><p id="_b1ee29e5-cb44-5005-ded8-513e7edb507b"><tt>ai.onnx</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_3913b805-d21f-bd96-17f3-4545c69fcadc"><p id="_86d5ee0e-36f2-b941-e9ab-6f858c70905c">7</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_e0bce822-9925-4b22-ef76-35e21afae0de"><p id="_41b7681c-befb-0308-712b-e7d23822eda7">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_ddf9be40-c49e-8ef5-1fee-876459827cdf"><p id="_491b19d2-94b0-9a1a-f046-e7354358061b"><tt>A (non-differentiable) : T</tt> — First input operand for the logical operator.<br/> <tt>B (non-differentiable) : T</tt> — Second input operand for the logical operator.</p>
</dd>
<dt>Outputs</dt>
<dd id="_5e1e5cf4-6691-6275-c89d-54ccecb73359"><p id="_a4a016db-87a2-d6a7-b167-3f04baad6169"><tt>C (non-differentiable) : T1</tt> — Result tensor.</p>
</dd>
<dt>Attributes</dt>
<dd id="_eba6f038-6aa1-b206-13e8-dfd8a44de3b0"><p id="_17641926-4ad1-14ec-92ef-b681b7fc0bbf">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_274104e6-3f7a-ffd5-2a0b-7b9420322660"><p id="_de0829cd-1b6f-c4d0-a4ac-af1b98f500cd"><tt>T : tensor(bool)</tt> — Constrain input to boolean tensor.<br/> <tt>T1 : tensor(bool)</tt> — Constrain output to boolean tensor.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_5c5db896-5e50-9438-eeb4-37cf9bd25658"><p id="_c40335d0-fe96-c999-5264-e80e05a07754"><tt>test_xor2d</tt>, <tt>test_xor3d</tt>, <tt>test_xor4d</tt>, <tt>test_xor_bcast3v1d</tt>, <tt>test_xor_bcast3v2d</tt>, <tt>test_xor_bcast4v2d</tt>, <tt>test_xor_bcast4v3d</tt>, <tt>test_xor_bcast4v4d</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_872485b0-ed96-a2d3-b663-9d12be876e57"><p id="_c6ff63b5-f776-5341-2def-ea8a010a1398">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>
</clause>

<clause id="_c4358b12-abd1-7bd6-3456-bb3349b03943" obligation="normative">
<title id="_e4b312c0-a759-c30b-b844-f628dedf6571">The ai.onnx.ml domain</title>
<clause id="_e081b729-1fd8-fa6b-0a73-e3546e40cb69" obligation="normative">
<title id="_24abdf30-6d12-8734-45d3-cd1948186a03">General</title>
<p id="_e11bf5e4-9f16-135d-781b-d212e47b5128">This clause specifies the operators of the <tt>ai.onnx.ml</tt> domain, in the form required by  <xref target="required-form" style="short"/>.</p>

<admonition id="_9b1db2a7-485d-636d-d494-167c58dcbab5" type="important">
<name id="_e2305847-5b27-1d9a-75f9-381884f6b9d4">Editorial note</name>
<p id="_6a66a610-3e84-a4de-84da-74b92ad5246a">This clause is generated from the upstream operator documentation, which does not supply three of the elements  <xref target="required-form" style="short"/> makes mandatory: shape inference, determinism and error conditions. Every operator below records their absence rather than omitting the elements, so that the incompleteness is visible where it matters instead of only in Annex C of <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/>.</p>

<p id="_78529a3f-c07c-10b8-ad05-86eb20886c10">Supplying them is the substance of the work this part represents. They cannot be generated, because the upstream source does not contain them; they have to be written, per operator, and agreed.</p>

<p id="_a112da84-eb7f-9c49-44f3-1fa0f8375efc">Operator prose below also refers to upstream documents that <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/> does not yet restate, broadcasting among them. Those references appear as plain text, because a normative cross-reference to a clause that does not exist would be worse than none. Annex C of <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/> records the omission.</p>
</admonition>
<note id="_c23abf0f-c05c-b323-dcf2-30c827fbbcea"><p id="_e6efdda5-85b4-0a8b-e7d0-12933452250e">Examples and sample implementations are not reproduced. They are informative under  <xref target="required-form" style="short"/>, and the reference implementation is not restated here; see Annex D of  <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/>. The test vector names extracted from the examples are retained, because  <eref type="inline" bibitemid="onnx-part-3" citeas="ONNX 1-3"/> needs them.</p>
</note>
</clause>

<clause id="_ac62420a-cef6-25ca-d53f-ee71c975dfda" anchor="op-ai-onnx-ml-ai.onnx.ml.arrayfeatureextractor" obligation="normative">
<title id="_e0d44fe5-2ca1-aa7e-e22d-8655aa296f8c">ai.onnx.ml.ArrayFeatureExtractor</title>
<p id="_bcb24051-bb50-104a-de93-5f86fdeb1906">Select elements of the input tensor based on the indices passed.</p>

<sourcecode id="_4653a54a-5bff-350a-eba9-7da062ed3ada" unnumbered="true"><body> The indices are applied to the last axes of the tensor.</body></sourcecode>


<dl id="_f5e64d53-2d3d-945b-60f1-00e9704d089a"><dt>Domain</dt>
<dd id="_09fa30a3-2dfd-8509-1b5c-2395e8c371b2"><p id="_296cc9eb-b1fd-5e8f-e668-2776ce7903ac"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_5dc05cdc-0960-5df0-0cec-a1b33addca53"><p id="_306fea10-a0e8-0a6c-8fec-573eb707cb43">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_579742d3-6862-5dba-d46c-2ae6c80a8de0"><p id="_0a26e0b0-c89a-0735-4596-7a0eb5b417a0"><tt>X : T</tt> — Data to be selected<br/> <tt>Y : tensor(int64)</tt> — The indices, based on 0 as the first index of any dimension.</p>
</dd>
<dt>Outputs</dt>
<dd id="_59d39677-b2b4-b414-1bf2-b10d97869429"><p id="_41102364-39ff-1f28-8913-7a3714126cb2"><tt>Z : T</tt> — Selected output data as an array</p>
</dd>
<dt>Attributes</dt>
<dd id="_d5c8a217-4176-803c-b61a-6776f4a70863"><p id="_01c3c0a7-6abd-53bd-2778-f60ad02eed8f">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_b6307ed6-3ee3-7501-2b9e-1e8c60cc6ee0"><p id="_89a923cd-134e-cce1-8cf7-f00e6bbbd5ea"><tt>T : tensor(float), tensor(double), tensor(int64), tensor(int32), tensor(string)</tt> — The input must be a tensor of a numeric type or string. The output will be of the same tensor type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_8d6757ee-7704-e3bc-fca5-922cc34b38c0"><p id="_e9378f76-03ac-1874-e5e9-ae8d40f72708"><tt>test_ai_onnx_ml_array_feature_extractor</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_4befda59-6863-092e-2c72-07b25404541a"><p id="_6ddc48b9-b036-d806-f4a8-c162b264c4d3">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_2362f186-de48-daa6-6ca4-a616758d8cc8" anchor="op-ai-onnx-ml-ai.onnx.ml.binarizer" obligation="normative">
<title id="_863ce6eb-1a27-a64d-986e-b71a8e649455">ai.onnx.ml.Binarizer</title>
<p id="_2f725116-f6ac-4d60-c506-fa98f40fe7cc">Maps the values of the input tensor to either 0 or 1, element-wise, based on the outcome of a comparison against a threshold value.</p>

<dl id="_408982d3-5439-6cc7-fdd4-52a47dcb0d14"><dt>Domain</dt>
<dd id="_eb42d22d-1af0-d46d-24ba-d9772a9c58af"><p id="_4375d6e1-c0af-fac8-2a03-8dcb34b93fe7"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_45cb630e-eae2-16c1-3d48-37e496c43295"><p id="_4d53054c-0641-1e55-e62f-679e90afcdfc">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_89766d5a-ea20-bd89-d705-f800d7f2a87e"><p id="_0cf6afa5-ec4a-2e99-07a3-3b43ba13c636"><tt>X : T</tt> — Data to be binarized</p>
</dd>
<dt>Outputs</dt>
<dd id="_3c724ce9-f67d-8d29-1a06-068640da5a91"><p id="_bf7536f2-173e-22c7-4b72-823a9e5c7a95"><tt>Y : T</tt> — Binarized output data</p>
</dd>
<dt>Attributes</dt>
<dd id="_47dbb61f-158c-a655-6868-383746c22219"><p id="_a2764071-dd71-440b-834e-9cab3d304c88"><tt>threshold : float (default is 0.0)</tt> — Values greater than this are mapped to 1, others to 0.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_1a20e498-fc5f-9d17-2645-e803a4c33f92"><p id="_84964f57-38e8-bbbc-25e6-5be9d5f29215"><tt>T : tensor(float), tensor(double), tensor(int64), tensor(int32)</tt> — The input must be a tensor of a numeric type. The output will be of the same tensor type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_70d05a4c-423f-b37e-e2d6-134e706d7667"><p id="_55035747-7fb3-3697-6651-4995d3f7d017"><tt>test_ai_onnx_ml_binarizer</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_84c791df-9adc-0ea9-466d-b9dd7c58397f"><p id="_bc004eaa-86e7-91da-ec51-bab6bc089278">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_2dee58ca-1805-f5d1-78fe-34bd656346b9" anchor="op-ai-onnx-ml-ai.onnx.ml.castmap" obligation="normative">
<title id="_138cf445-b8f3-760f-14aa-2c7e99572149">ai.onnx.ml.CastMap</title>
<p id="_7ddb70f0-4d12-c282-ce75-7322e83f2e12">Converts a map to a tensor. The map key must be an int64 and the values will be ordered     in ascending order based on this key. The operator supports dense packing or sparse packing.     If using sparse packing, the key cannot exceed the max_map-1 value.</p>

<dl id="_ffaa8dc6-bfcd-05e0-6360-a80048b3c7bc"><dt>Domain</dt>
<dd id="_6137ace2-2fe6-8b67-b307-0c7af22d7557"><p id="_eb31db98-a9c2-0657-4f74-0bfde26f2a15"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_6d08f062-3c9f-5987-2c7a-b7fc63b11ecf"><p id="_b71c5287-c631-59bd-5ced-8aa6b85e2a6b">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_a5532226-2f46-8da0-b916-b9fc575892fc"><p id="_671c9c42-d66b-b607-f5ce-c6000961a35d"><tt>X : T1</tt> — The input map that is to be cast to a tensor</p>
</dd>
<dt>Outputs</dt>
<dd id="_5b65dc8b-5f1c-b831-719c-cb7fe0073ef4"><p id="_7d6252d4-a212-0e08-c593-c1766d7e031e"><tt>Y : T2</tt> — A tensor representing the same data as the input map, ordered by their keys</p>
</dd>
<dt>Attributes</dt>
<dd id="_95cbf38d-de3f-7531-cfe3-8c323f4d5ab4"><p id="_3d53060b-8ad6-96a1-c38d-52046e3350f9"><tt>cast_to : string (default is TO_FLOAT)</tt> — A string indicating the desired element type of the output tensor, one of ‘TO_FLOAT’, ‘TO_STRING’, ‘TO_INT64’.<br/> <tt>map_form : string (default is DENSE)</tt> — Indicates whether to only output as many values as are in the input (dense), or position the input based on using the key of the map as the index of the output (sparse).One of ‘DENSE’, ‘SPARSE’.<br/> <tt>max_map : int (default is 1)</tt> — If the value of map_form is ‘SPARSE,’ this attribute indicates the total length of the output tensor.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_1fc085cd-ba76-0f4f-1690-52e3e62214c0"><p id="_1460f9f2-4aec-f424-ba8c-5fde0bb90802"><tt>T1 : map(int64, string), map(int64, float)</tt> — The input must be an integer map to either string or float.<br/> <tt>T2 : tensor(string), tensor(float), tensor(int64)</tt> — The output is a 1-D tensor of string, float, or integer.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_b0b96de1-0842-f580-6ed3-cd1f48c2d29c"><p id="_0d369317-4c9f-3592-2dc3-9e32bab47964">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_d6cb50fa-fb96-faa5-55ff-1a29bd95a86f"><p id="_4eec53bf-aab4-62e9-243c-3be058aa95da">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_49fe159a-a8d3-3962-90b3-62ae1af196d0" anchor="op-ai-onnx-ml-ai.onnx.ml.categorymapper" obligation="normative">
<title id="_2aa57f7b-01d3-52c2-b599-3107fc53abe0">ai.onnx.ml.CategoryMapper</title>
<p id="_ef59ec9c-9eb2-edb4-6521-92af2a42f24b">Converts strings to integers and vice versa.</p>

<sourcecode id="_b0dd4d31-2062-07b1-5c93-0f5f2cf0f734" unnumbered="true"><body>Two sequences of equal length are used to map between integers and strings,
with strings and integers at the same index detailing the mapping.

Each operator converts either integers to strings or strings to integers, depending
on which default value attribute is provided. Only one default value attribute
should be defined.

If the string default value is set, it will convert integers to strings.
If the int default value is set, it will convert strings to integers.</body></sourcecode>


<dl id="_4e2893be-cac8-c087-c737-9ab4ac605534"><dt>Domain</dt>
<dd id="_d6799c59-9efe-fcba-b366-0eef5d40f645"><p id="_00d64040-7373-e4d3-6288-97322f832b4b"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_931ebd3a-68f8-dce2-5c44-a0057ac959a0"><p id="_6a36914b-3555-9be0-a966-901236f62961">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_e86f98b5-0efa-58a9-6454-7daafbbd1f47"><p id="_7c3aa7e3-ccb7-747c-1e36-a529a772db5d"><tt>X : T1</tt> — Input data</p>
</dd>
<dt>Outputs</dt>
<dd id="_fa479b34-8803-3271-b4e5-5b58ce400621"><p id="_65105b52-9711-d6ac-6749-0448b3a282d4"><tt>Y : T2</tt> — Output data. If strings are input, the output values are integers, and vice versa.</p>
</dd>
<dt>Attributes</dt>
<dd id="_e3e3d65f-3007-1843-6eb4-5b402702c900"><p id="_464b2582-e0a1-2d98-bdba-02136f7317af"><tt>cats_int64s : list of ints</tt> — The integers of the map. This sequence must be the same length as the ‘cats_strings’ sequence.<br/> <tt>cats_strings : list of strings</tt> — The strings of the map. This sequence must be the same length as the ‘cats_int64s’ sequence<br/> <tt>default_int64 : int (default is -1)</tt> — An integer to use when an input string value is not found in the map.One and only one of the ‘default_*’ attributes must be defined.<br/> <tt>default_string : string (default is _Unused)</tt> — A string to use when an input integer value is not found in the map.One and only one of the ‘default_*’ attributes must be defined.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_8aa5d528-ebd5-fb11-a3d9-dbde5fe35707"><p id="_8af94d56-d708-c213-68ae-835838760123"><tt>T1 : tensor(string), tensor(int64)</tt> — The input must be a tensor of strings or integers, either [N,C] or [C].<br/> <tt>T2 : tensor(string), tensor(int64)</tt> — The output is a tensor of strings or integers. Its shape will be the same as the input shape.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_f99700c4-4253-4179-3c86-065a297971b5"><p id="_91736a5f-72e7-3f0c-6b4a-95260851032b">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_1b59f28b-6c12-fa3c-2364-6de0f61c9221"><p id="_8e179b6e-4716-4b3d-0713-e4513e053d37">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_d4a3bf80-65d8-32e0-a00d-c486fbde4843" anchor="op-ai-onnx-ml-ai.onnx.ml.dictvectorizer" obligation="normative">
<title id="_8e3e63cc-deb0-18a0-96b6-2d0697a6ad7d">ai.onnx.ml.DictVectorizer</title>
<p id="_42e581e6-fa92-55b4-bea1-b4272ead9b9a">Uses an index mapping to convert a dictionary to an array.</p>

<sourcecode id="_ab29a261-f3fe-203b-f810-10d997caa075" unnumbered="true"><body>Given a dictionary, each key is looked up in the vocabulary attribute corresponding to
the key type. The index into the vocabulary array at which the key is found is then
used to index the output 1-D tensor 'Y' and insert into it the value found in the dictionary 'X'.

The key type of the input map must correspond to the element type of the defined vocabulary attribute.
Therefore, the output array will be equal in length to the index mapping vector parameter.
All keys in the input dictionary must be present in the index mapping vector.
For each item in the input dictionary, insert its value in the output array.
Any keys not present in the input dictionary, will be zero in the output array.

For example: if the ``string_vocabulary`` parameter is set to ``["a", "c", "b", "z"]``,
then an input of ``{"a": 4, "c": 8}`` will produce an output of ``[4, 8, 0, 0]``.</body></sourcecode>


<dl id="_b6548845-916d-c90f-e58d-933621348d17"><dt>Domain</dt>
<dd id="_bfa2e8e4-59ec-61da-a8e8-b80273f82477"><p id="_1d4803a9-0ffa-300c-60d9-e5be78044821"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_cc4ec80f-a71f-c667-fb5a-c17643bf182f"><p id="_a99eecf6-6d24-090d-9b5e-89b5e668dfe6">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_c4c84efc-e988-a4fc-7cba-4da9c0a84393"><p id="_c986ec5f-f0e3-4037-50b8-613482687d85"><tt>X : T1</tt> — A dictionary.</p>
</dd>
<dt>Outputs</dt>
<dd id="_94418082-5824-05e3-92b4-61c1c692a066"><p id="_e3081797-f613-8266-3ce5-c2c35bd2bf96"><tt>Y : T2</tt> — A 1-D tensor holding values from the input dictionary.</p>
</dd>
<dt>Attributes</dt>
<dd id="_55d512b4-a7c1-920b-e97d-37cbd45548cc"><p id="_2a57eb64-c80f-772e-fcdf-fe9cfcbd5145"><tt>int64_vocabulary : list of ints</tt> — An integer vocabulary array.One and only one of the vocabularies must be defined.<br/> <tt>string_vocabulary : list of strings</tt> — A string vocabulary array.One and only one of the vocabularies must be defined.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_ab0a145c-03b3-cb23-9097-fe9db12c5a53"><p id="_553857dc-e191-a230-1897-2abe99a4d9df"><tt>T1 : map(string, int64), map(int64, string), map(int64, float), map(int64, double), map(string, float), map(string, double)</tt> — The input must be a map from strings or integers to either strings or a numeric type. The key and value types cannot be the same.<br/> <tt>T2 : tensor(int64), tensor(float), tensor(double), tensor(string)</tt> — The output will be a tensor of the value type of the input map. It’s shape will be [1,C], where C is the length of the input dictionary.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_25bd15d1-5710-3805-5fc1-415378dec79a"><p id="_16647cff-1bfb-a72c-ac12-6aed3911f39e">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_e972a8eb-8bf6-bc25-bcbf-539b594b69ce"><p id="_15d83c9d-5ef1-84d4-b184-c75827c25a4f">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_4405716c-0c79-06f8-8cfd-340904f55ad5" anchor="op-ai-onnx-ml-ai.onnx.ml.featurevectorizer" obligation="normative">
<title id="_49657b98-c5ae-7765-f09b-547cbf8e3220">ai.onnx.ml.FeatureVectorizer</title>
<p id="_f81a4812-9ba5-6af4-a372-ff12a34b64cc">Concatenates input tensors into one continuous output.</p>

<sourcecode id="_6a4d31ca-698d-79ee-f98e-c8acf89351d5" unnumbered="true"><body>All input shapes are 2-D and are concatenated along the second dimension. 1-D tensors are treated as [1,C].
Inputs are copied to the output maintaining the order of the input arguments.

All inputs must be integers or floats, while the output will be all floating point values.</body></sourcecode>


<dl id="_a5271d96-1cf3-ff75-4dcd-1db1912a93ee"><dt>Domain</dt>
<dd id="_e5b2cc95-cb8b-ec69-a47c-190e17fd3c28"><p id="_039da867-7f40-16a7-2e23-ee822a79963e"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_ec1ba1d8-28f2-fcf4-7937-d7dba7041ee3"><p id="_1e1995a0-f884-09c6-a69b-39aae1f49b8d">1</p>
</dd>
<dt>Inputs (1 — unbounded)</dt>
<dd id="_08c60f95-b15b-b868-ea19-cecef2408bcc"><p id="_54e361f3-6dc5-03d1-4aab-209aa2467cbf"><tt>X (variadic) : T1</tt> — An ordered collection of tensors, all with the same element type.</p>
</dd>
<dt>Outputs</dt>
<dd id="_93f92272-2a0b-155b-1dab-dfae618ddb4d"><p id="_28e090cb-c3f1-2509-7b1e-e9b541d87614"><tt>Y : tensor(float)</tt> — The output array, elements ordered as the inputs.</p>
</dd>
<dt>Attributes</dt>
<dd id="_44b8abee-0810-68b3-8b5c-b537668ee282"><p id="_f6b6a449-b63c-a4c0-f593-c93c307ef0e5"><tt>inputdimensions : list of ints</tt> — The size of each input in the input list</p>
</dd>
<dt>Type constraints</dt>
<dd id="_f745106b-f757-091e-4036-239f5c3cff99"><p id="_6cd3c0b3-a363-6cff-ff84-cfd448bec74c"><tt>T1 : tensor(int32), tensor(int64), tensor(float), tensor(double)</tt> — The input type must be a tensor of a numeric type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_81070ffc-d95a-ff7b-33c2-0b95981fc40c"><p id="_ec0a491b-2669-f96d-f749-2eb335f3a1aa">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_77deeb80-4f33-bdee-d91a-c46d12707f05"><p id="_96882bce-00c7-41c7-1a46-9935270a906f">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_58b2d3b3-cc56-1ea5-6769-e3a6316d1285" anchor="op-ai-onnx-ml-ai.onnx.ml.imputer" obligation="normative">
<title id="_c9b652f0-e56f-d772-391d-554718a4b6bc">ai.onnx.ml.Imputer</title>
<p id="_63d938e6-1050-4ae5-316d-35aaafa7a98b">Replaces inputs that equal one value with another, leaving all other elements alone.</p>

<sourcecode id="_40b1160a-444e-dcc1-4f16-c91ff0a69a6c" unnumbered="true"><body>This operator is typically used to replace missing values in situations where they have a canonical
representation, such as -1, 0, NaN, or some extreme value.

One and only one of imputed_value_floats or imputed_value_int64s should be defined -- floats if the input tensor
holds floats, integers if the input tensor holds integers. The imputed values must all fit within the
width of the tensor element type. One and only one of the replaced_value_float or replaced_value_int64 should be defined,
which one depends on whether floats or integers are being processed.

The imputed_value attribute length can be 1 element, or it can have one element per input feature. In other words, if the input tensor has the shape [*,F], then the length of the attribute array may be 1 or F. If it is 1, then it is broadcast along the last dimension and applied to each feature.</body></sourcecode>


<dl id="_4d2d1e8c-ef3a-1f33-41d1-fd25ad68eace"><dt>Domain</dt>
<dd id="_8c92a4df-979c-f385-7023-c29bf3dba299"><p id="_2d63ce6f-9607-2008-3786-91144e8fdc94"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_ccff60aa-b516-14cb-9f1a-557c13e862c8"><p id="_e50626ef-08a2-13c2-b940-b6c3d485a8db">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_e4fe44d4-7f0c-8330-92a6-9064f450d35e"><p id="_14794e24-c044-867f-0523-ee97429027ef"><tt>X : T</tt> — Data to be processed.</p>
</dd>
<dt>Outputs</dt>
<dd id="_a8afccd4-2d21-bb82-065d-8170c3902869"><p id="_8deba300-977f-2767-cdde-3d030aee690b"><tt>Y : T</tt> — Imputed output data</p>
</dd>
<dt>Attributes</dt>
<dd id="_6589c1db-9c5f-b2f9-b879-78029f6880e0"><p id="_4504239d-eb73-a5b3-ff3e-37f9b237c689"><tt>imputed_value_floats : list of floats</tt> — Value(s) to change to<br/> <tt>imputed_value_int64s : list of ints</tt> — Value(s) to change to.<br/> <tt>replaced_value_float : float (default is 0.0)</tt> — A value that needs replacing.<br/> <tt>replaced_value_int64 : int (default is 0)</tt> — A value that needs replacing.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_6d5fc45a-6e0d-9429-e6d8-c63c1fcfae96"><p id="_10fd1388-4585-1346-9b1a-c8d004250c91"><tt>T : tensor(float), tensor(double), tensor(int64), tensor(int32)</tt> — The input type must be a tensor of a numeric type, either [N,C] or [C]. The output type will be of the same tensor type and shape.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_681d34e4-5176-f618-2c23-4d5992f10a1c"><p id="_b0c2360f-4fbd-0f85-d39d-13a9198014ec">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_735d3308-432c-4009-2b44-f3a8433d7a75"><p id="_40796ec2-0ae1-a521-bdb7-79064d326d53">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_16eb13a7-fd21-b8c7-7704-9cad5b070be3" anchor="op-ai-onnx-ml-ai.onnx.ml.labelencoder" obligation="normative">
<title id="_5cf14c6d-1a51-74a4-e93b-64f2c7844e4f">ai.onnx.ml.LabelEncoder</title>
<p id="_1a4e69de-8f7a-68b2-9b4f-57ccaf9ab473">Maps each element in the input tensor to another value.</p>

<sourcecode id="_d34e83d5-7107-3fbf-b835-3014d762f0eb" unnumbered="true"><body>The mapping is determined by the two parallel attributes, 'keys_*' and
'values_*' attribute. The i-th value in the specified 'keys_*' attribute
would be mapped to the i-th value in the specified 'values_*' attribute. It
implies that input's element type and the element type of the specified
'keys_*' should be identical while the output type is identical to the
specified 'values_*' attribute. Note that the 'keys_*' and 'values_*' attributes
must have the same length. If an input element can not be found in the
specified 'keys_*' attribute, the 'default_*' that matches the specified
'values_*' attribute may be used as its output value. The type of the 'default_*'
attribute must match the 'values_*' attribute chosen.

Let's consider an example which maps a string tensor to an integer tensor.
Assume and 'keys_strings' is ["Amy", "Sally"], 'values_int64s' is [5, 6],
and 'default_int64' is '-1'.  The input ["Dori", "Amy", "Amy", "Sally",
"Sally"] would be mapped to [-1, 5, 5, 6, 6].

Since this operator is an one-to-one mapping, its input and output shapes
are the same. Notice that only one of 'keys_*'/'values_*' can be set.

Float keys with value 'NaN' match any input 'NaN' value regardless of bit
value. If a key is repeated, the last key takes precedence.</body></sourcecode>


<dl id="_1ab8b04a-88fe-7765-2165-09a934904131"><dt>Domain</dt>
<dd id="_435d0dad-abb3-fb49-fab2-8e76522191fe"><p id="_5e7695cd-7926-8a8c-7d57-e0797310a764"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_377f49b4-a276-32ff-6e66-863107e0e065"><p id="_4178776a-7ff6-be33-952e-b228411261e9">4</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_e82b825b-a083-b6fd-1817-ebf478ce6499"><p id="_0851a6c3-5531-aa4f-bf28-154794d71998">1, 2</p>
</dd>
<dt>Inputs</dt>
<dd id="_3a4bbe7d-6d45-44c4-9290-5aba10ef01de"><p id="_129f0f51-e892-4a91-47d9-7b4bdc3a260a"><tt>X : T1</tt> — Input data. It must have the same element type as the keys_* attribute set.</p>
</dd>
<dt>Outputs</dt>
<dd id="_89ad9439-80bd-6c47-12b8-9a76a99f9719"><p id="_678440bc-8f96-778d-dab8-5c2f759e5c7e"><tt>Y : T2</tt> — Output data. This tensor’s element type is based on the values_* attribute set.</p>
</dd>
<dt>Attributes</dt>
<dd id="_9f6d1d32-415e-13c6-05b5-d6ab13e5ee9b"><p id="_496189e0-77e5-97ba-79aa-0a4af2109e84"><tt>default_float : float (default is -0.0)</tt> — A float.<br/> <tt>default_int64 : int (default is -1)</tt> — An integer.<br/> <tt>default_string : string (default is _Unused)</tt> — A string.<br/> <tt>default_tensor : tensor</tt> — A default tensor. {”<em>Unused”} if values</em>* has string type, {-1} if values_* has integral type, and {-0.f} if values_* has float type.<br/> <tt>keys_floats : list of floats</tt> — A list of floats.<br/> <tt>keys_int64s : list of ints</tt> — A list of ints.<br/> <tt>keys_strings : list of strings</tt> — A list of strings.<br/> <tt>keys_tensor : tensor</tt> — Keys encoded as a 1D tensor. One and only one of ‘keys_*’s should be set.<br/> <tt>values_floats : list of floats</tt> — A list of floats.<br/> <tt>values_int64s : list of ints</tt> — A list of ints.<br/> <tt>values_strings : list of strings</tt> — A list of strings.<br/> <tt>values_tensor : tensor</tt> — Values encoded as a 1D tensor. One and only one of ‘values_*’s should be set.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_e378efef-68d5-87b7-a39f-704fde3aabfc"><p id="_545175e6-167f-0790-8931-b0b793a235b0"><tt>T1 : tensor(string), tensor(int64), tensor(float), tensor(int32), tensor(int16), tensor(double)</tt> — The input type is a tensor of any shape.<br/> <tt>T2 : tensor(string), tensor(int64), tensor(float), tensor(int32), tensor(int16), tensor(double)</tt> — Output type is determined by the specified ‘values_*’ attribute.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_64f5e56d-1efd-1457-cab7-c5a164ee3c5e"><p id="_d8ee3898-5945-a5bd-d0ef-4103cd14af38"><tt>test_ai_onnx_ml_label_encoder_string_int</tt>, <tt>test_ai_onnx_ml_label_encoder_string_int_no_default</tt>, <tt>test_ai_onnx_ml_label_encoder_tensor_mapping</tt>, <tt>test_ai_onnx_ml_label_encoder_tensor_value_only_mapping</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_d2d2da7c-11df-1bba-7ff5-a0d466ed9c80"><p id="_6554b851-44a2-8d31-748b-5573dc7afa33">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_bdadcc6d-9b52-1c5c-86e3-d8d8762ef38d" anchor="op-ai-onnx-ml-ai.onnx.ml.linearclassifier" obligation="normative">
<title id="_e501a666-4c2c-29e3-622e-620591cacc61">ai.onnx.ml.LinearClassifier</title>
<p id="_cc0e439f-19eb-60d9-fa5e-cc5c1d022dfa">Linear classifier</p>

<dl id="_b088fd7a-5ef1-5d7d-f07d-b3bb704385a7"><dt>Domain</dt>
<dd id="_8a54205d-f536-ce98-5914-4d9a5039e67e"><p id="_1092fd22-5bd6-f0ff-acef-0ee2ad75c178"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_baf39e42-a388-8274-7c2b-3e40bbbb5ae2"><p id="_f3bf2194-1594-b692-582a-4cbac75efe93">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_7651400a-d434-63f1-448c-f1267e0747c8"><p id="_fceb0369-121a-664c-55c4-329533bccd68"><tt>X : T1</tt> — Data to be classified.</p>
</dd>
<dt>Outputs</dt>
<dd id="_7bf784e3-6463-f8ae-bed3-00d8f302f3bb"><p id="_884039e7-c7ef-6f3d-bc97-fa82d550aaac"><tt>Y : T2</tt> — Classification outputs (one class per example).<br/> <tt>Z : tensor(float)</tt> — Classification scores ([N,E] — one score for each class and example</p>
</dd>
<dt>Attributes</dt>
<dd id="_2e85f0e2-a7cc-6779-fa2c-6ff336903dbb"><p id="_c14e8ff7-c578-43b2-2faa-3c4a1d10bac2"><tt>classlabels_ints : list of ints</tt> — Class labels when using integer labels. One and only one ‘classlabels’ attribute must be defined.<br/> <tt>classlabels_strings : list of strings</tt> — Class labels when using string labels. One and only one ‘classlabels’ attribute must be defined.<br/> <tt>coefficients : list of floats (required)</tt> — A collection of weights of the model(s).<br/> <tt>intercepts : list of floats</tt> — A collection of intercepts.<br/> <tt>multi_class : int (default is 0)</tt> — Indicates whether to do OvR or multinomial (0=OvR is the default).<br/> <tt>post_transform : string (default is NONE)</tt> — Indicates the transform to apply to the scores vector.One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT’</p>
</dd>
<dt>Type constraints</dt>
<dd id="_d06f81de-0618-8005-95f7-f1b591cb2347"><p id="_74027881-1e6d-b882-4723-c897a85d5460"><tt>T1 : tensor(float), tensor(double), tensor(int64), tensor(int32)</tt> — The input must be a tensor of a numeric type, and of shape [N,C] or [C]. In the latter case, it will be treated as [1,C]<br/> <tt>T2 : tensor(string), tensor(int64)</tt> — The output will be a tensor of strings or integers.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_aad765c6-2eca-5a18-08f2-6748d2ae28bd"><p id="_38dc88e3-e027-c2d9-9cb9-12b278276ccb">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_9915ee5b-b60e-ab5a-8584-968038317ab0"><p id="_671d2096-bb6c-01f7-ecf9-bf2c4fcf9028">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_0eb03053-7e05-5f03-4374-250cf3f993ca" anchor="op-ai-onnx-ml-ai.onnx.ml.linearregressor" obligation="normative">
<title id="_2d5f30a7-0b07-7e96-af81-ee5453544217">ai.onnx.ml.LinearRegressor</title>
<p id="_7c0723b4-deaa-113d-1775-6791cb0b3c86">Generalized linear regression evaluation.</p>

<sourcecode id="_b0e0b6c6-8ca7-4af5-99ef-75cbdeeddd6f" unnumbered="true"><body>If targets is set to 1 (default) then univariate regression is performed.

If targets is set to M then M sets of coefficients must be passed in as a sequence
and M results will be output for each input n in N.

The coefficients array is of length n, and the coefficients for each target are contiguous.
Intercepts are optional but if provided must match the number of targets.</body></sourcecode>


<dl id="_84befdaa-0f48-b1a6-dcb4-cc700d32dc66"><dt>Domain</dt>
<dd id="_c4ae5f52-d1f8-4028-7cd5-90a7203bd4f3"><p id="_3bcc7ab0-1927-b1be-760d-f850b7c20d31"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_5c96c174-4f7e-280f-6a5a-e3ee2edceab0"><p id="_80af1a08-ea78-47fb-5f89-f50b9359f1fb">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_76155c26-74da-38d4-2efd-e782aef3704d"><p id="_55fb5046-deff-3169-6c78-c9b3af8d6bf0"><tt>X : T</tt> — Data to be regressed.</p>
</dd>
<dt>Outputs</dt>
<dd id="_13151b4d-cb81-f2ba-7443-8890a7816cc4"><p id="_76cf2833-dc1c-da7d-782f-0f1f8aced569"><tt>Y : tensor(float)</tt> — Regression outputs (one per target, per example).</p>
</dd>
<dt>Attributes</dt>
<dd id="_cdcd124c-af0f-d221-44a8-08ff1a1f7197"><p id="_dac3c7a4-f76f-f459-dca4-2eadc67bb20c"><tt>coefficients : list of floats</tt> — Weights of the model(s).<br/> <tt>intercepts : list of floats</tt> — Weights of the intercepts, if used.<br/> <tt>post_transform : string (default is NONE)</tt> — Indicates the transform to apply to the regression output vector.One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT’<br/> <tt>targets : int (default is 1)</tt> — The total number of regression targets, 1 if not defined.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_51f6f15f-90cb-0858-f3b7-faf779fa7610"><p id="_babdf7a2-c279-f6d3-4a73-c75ae87c65dd"><tt>T : tensor(float), tensor(double), tensor(int64), tensor(int32)</tt> — The input must be a tensor of a numeric type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_25750c8f-adc8-1c1c-dca6-6145818b6d4f"><p id="_04f749b4-23dc-caab-7cf4-b8631f282e79">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_14fccc18-321a-67e4-4d3d-24b80cf0b6e4"><p id="_7926ba33-c4d7-e6cd-079b-ce12eb63ca9d">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_f729231e-e245-b392-3fe2-838f89620415" anchor="op-ai-onnx-ml-ai.onnx.ml.normalizer" obligation="normative">
<title id="_d463a282-575d-cec7-900a-67446e32754e">ai.onnx.ml.Normalizer</title>
<p id="_f6f4bb03-4b3b-9c73-381d-be8e37f7f218">Normalize the input.  There are three normalization modes, which have the corresponding formulas,     defined using element-wise infix operators ‘/’ and ‘^’ and tensor-wide functions ‘max’ and ‘sum’:</p>

<sourcecode id="_66f1a8fe-dd82-b833-f28b-a1ecc3758039" unnumbered="true"><body>Max: Y = X / max(X)

L1:  Y = X / sum(X)

L2:  Y = sqrt(X^2 / sum(X^2)}

In all modes, if the divisor is zero, Y == X.


For batches, that is, [N,C] tensors, normalization is done along the C axis. In other words, each row
of the batch is normalized independently.</body></sourcecode>


<dl id="_f4f00c37-0660-297f-7283-347ac9394357"><dt>Domain</dt>
<dd id="_bdc49d9b-9e42-e631-40c8-1d9de0a53357"><p id="_efd86bdb-24fa-e8db-be34-f900d732026b"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_374e910c-1a54-0810-be7d-09a177010b1a"><p id="_3960fc2a-e9cd-884f-812b-8798051f2d9d">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_ab41fe3c-0f6c-7d3d-03e2-f52c60b981b0"><p id="_39e08ec9-173e-42c6-a750-2124a23113f0"><tt>X : T</tt> — Data to be encoded, a tensor of shape [N,C] or [C]</p>
</dd>
<dt>Outputs</dt>
<dd id="_1fa57406-7eb7-feb6-430c-229040056634"><p id="_820e56a8-f282-94cc-f892-b163915b23bd"><tt>Y : tensor(float)</tt> — Encoded output data</p>
</dd>
<dt>Attributes</dt>
<dd id="_448847b8-049b-7da1-48ba-458632ee6291"><p id="_12fe4fee-9be6-206e-351c-516b846dc929"><tt>norm : string (default is MAX)</tt> — One of ‘MAX,’ ‘L1,’ ‘L2’</p>
</dd>
<dt>Type constraints</dt>
<dd id="_6516c4be-9692-8475-1c4e-84014c60394c"><p id="_fe92a4d4-e6dc-c9c6-07ae-ebba17556003"><tt>T : tensor(float), tensor(double), tensor(int64), tensor(int32)</tt> — The input must be a tensor of a numeric type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_e992d90d-632b-ded7-6e08-0ca2bbf36682"><p id="_8d3306fb-d705-7d41-0098-ea7ad3bdb09b">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_f06d9893-c112-714a-3f22-6b70c9532dfd"><p id="_9bade12f-93a9-291b-bd6c-88aa20f29c02">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_1acfd47b-8871-3283-3c75-e95cefa0c1f3" anchor="op-ai-onnx-ml-ai.onnx.ml.onehotencoder" obligation="normative">
<title id="_7fdcb22f-32ca-4df9-af82-3f8db0008c22">ai.onnx.ml.OneHotEncoder</title>
<p id="_f822dfaa-a30b-cc0d-f449-370c5992f6f7">Replace each input element with an array of ones and zeros, where a single     one is placed at the index of the category that was passed in. The total category count     will determine the size of the extra dimension of the output array Y.</p>

<sourcecode id="_2dbd3e0d-41d0-1c64-4b58-eee76f28220f" unnumbered="true"><body>For example, if we pass a tensor with a single value of 4, and a category count of 8,
the output will be a tensor with ``[0,0,0,0,1,0,0,0]``.

This operator assumes every input feature is from the same set of categories.

If the input is a tensor of float, int32, or double, the data will be cast
to integers and the cats_int64s category list will be used for the lookups.</body></sourcecode>


<dl id="_9a69a7b2-4227-bb44-1200-f766421b7c69"><dt>Domain</dt>
<dd id="_093f083b-b1e8-8b12-8021-ba790502da42"><p id="_98ed06a3-8fb5-972b-54e7-a281113f52eb"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_58526438-59d3-7978-8b72-1e1ff586c2b7"><p id="_e1cb8139-7e57-7366-097c-c17791603369">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_20bef199-2926-4641-8e7b-e54305b01829"><p id="_73dd7441-2eeb-e1c6-b193-3d74f7d41baf"><tt>X : T</tt> — Data to be encoded.</p>
</dd>
<dt>Outputs</dt>
<dd id="_c2724575-53b4-455d-df72-93150c265c9e"><p id="_cb9c1fab-a4fe-12fc-300b-6582d61438ab"><tt>Y : tensor(float)</tt> — Encoded output data, having one more dimension than X.</p>
</dd>
<dt>Attributes</dt>
<dd id="_3869ea8b-b6fb-c09f-2450-0de512545ed3"><p id="_02ee871e-a442-4da6-18c0-f6ad007ac09e"><tt>cats_int64s : list of ints</tt> — List of categories, ints.One and only one of the ‘cats_*’ attributes must be defined.<br/> <tt>cats_strings : list of strings</tt> — List of categories, strings.One and only one of the ‘cats_*’ attributes must be defined.<br/> <tt>zeros : int (default is 1)</tt> — If true and category is not present, will return all zeros; if false and a category if not found, the operator will fail.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_96ae61a8-6f70-9426-bc40-d817abbed20e"><p id="_6d112777-264e-229f-beb3-fe0ec0171f9f"><tt>T : tensor(string), tensor(int64), tensor(int32), tensor(float), tensor(double)</tt> — The input must be a tensor of a numeric type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_92143352-34e9-fde2-ea1c-9ae159fa906e"><p id="_3fd70c17-7b65-d8ec-38bb-0b4537f48f31">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_736f2956-3310-1f34-afb6-7c60df53a714"><p id="_82fc4d0f-42f7-3fc2-a3b0-ab5167c4477c">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_480758cc-b102-c81e-6404-ce8191105abb" anchor="op-ai-onnx-ml-ai.onnx.ml.svmclassifier" obligation="normative">
<title id="_ed0e3a5e-84b7-1357-7798-19f915c51c2f">ai.onnx.ml.SVMClassifier</title>
<p id="_7987935f-c68a-c33a-65c9-deb60c22950b">Support Vector Machine classifier</p>

<dl id="_2118afee-983e-8a7e-55a2-3f0bd9ffcb21"><dt>Domain</dt>
<dd id="_b0b87c51-d8f3-055b-6a5e-4ab822128687"><p id="_2cfe41ed-404f-cbb8-a665-0e27d346c23f"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_6040e711-6fed-036f-7425-ce48875760d2"><p id="_01e258b7-0ac7-d502-a909-f3677dbc24bb">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_f968ce98-030b-e648-7d61-5b36943fe821"><p id="_8ad13420-e004-802a-5b60-7e58e4e7ba7d"><tt>X : T1</tt> — Data to be classified.</p>
</dd>
<dt>Outputs</dt>
<dd id="_d10775b8-b75e-fd41-cafd-b51a1b778bad"><p id="_59e3d599-8a03-b2a2-6ba3-3b8e9b4bfbc3"><tt>Y : T2</tt> — Classification outputs (one class per example).<br/> <tt>Z : tensor(float)</tt> — Class scores (one per class per example), if prob_a and prob_b are provided they are probabilities for each class, otherwise they are raw scores.</p>
</dd>
<dt>Attributes</dt>
<dd id="_38af7b34-8dc6-97af-38e0-f80ede20ef80"><p id="_19cebeaa-f762-7daa-d781-c6e098d4ea96"><tt>classlabels_ints : list of ints</tt> — Class labels if using integer labels.One and only one of the ‘classlabels_*’ attributes must be defined.<br/> <tt>classlabels_strings : list of strings</tt> — Class labels if using string labels.One and only one of the ‘classlabels_*’ attributes must be defined.<br/> <tt>coefficients : list of floats</tt><br/> <tt>kernel_params : list of floats</tt> — List of 3 elements containing gamma, coef0, and degree, in that order. Zero if unused for the kernel.<br/> <tt>kernel_type : string (default is LINEAR)</tt> — The kernel type, one of ‘LINEAR,’ ‘POLY,’ ‘RBF,’ ‘SIGMOID’.<br/> <tt>post_transform : string (default is NONE)</tt> — Indicates the transform to apply to the score. One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT’<br/> <tt>prob_a : list of floats</tt> — First set of probability coefficients.<br/> <tt>prob_b : list of floats</tt> — Second set of probability coefficients. This array must be same size as prob_a.If these are provided then output Z are probability estimates, otherwise they are raw scores.<br/> <tt>rho : list of floats</tt><br/> <tt>support_vectors : list of floats</tt><br/> <tt>vectors_per_class : list of ints</tt></p>
</dd>
<dt>Type constraints</dt>
<dd id="_de6c9185-8d76-7bc2-e9ac-b0e65f6b0592"><p id="_84a3ab9f-8e98-a0b9-474e-8d352bac0e43"><tt>T1 : tensor(float), tensor(double), tensor(int64), tensor(int32)</tt> — The input must be a tensor of a numeric type, either [C] or [N,C].<br/> <tt>T2 : tensor(string), tensor(int64)</tt> — The output type will be a tensor of strings or integers, depending on which of the classlabels_* attributes is used. Its size will match the batch size of the input.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_9160f013-d672-d7c8-6377-cb9935a06ea7"><p id="_28da0893-feb1-9a1b-4546-2b61030d4151">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_a5b337db-fbfd-56ea-e661-3566abd7ebb0"><p id="_2627b7ed-ff20-a9d7-5068-b5f903f6eec4">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_6ef12fa8-4e65-3aca-2149-a5ef1a68d93b" anchor="op-ai-onnx-ml-ai.onnx.ml.svmregressor" obligation="normative">
<title id="_8ee4df33-72d5-033a-c41d-01354955e57e">ai.onnx.ml.SVMRegressor</title>
<p id="_166bf6e4-cd85-6484-6c8d-aae6d6dda021">Support Vector Machine regression prediction and one-class SVM anomaly detection.</p>

<dl id="_d10ecb63-a0c6-f032-4e10-50cfbc3c3f1b"><dt>Domain</dt>
<dd id="_21f0d519-61ae-b070-3e0d-532701441b67"><p id="_1c2aa57b-3fdf-0cfb-54d0-f8986d774216"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_a9f1b167-f1f7-7533-4003-89783a31f562"><p id="_e376beb4-bf08-c782-5ab9-2183753735ae">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_58c05735-da33-97d3-a51e-c37b694d00d1"><p id="_82fb106d-e1b2-ac29-a780-d41d68af8faf"><tt>X : T</tt> — Data to be regressed.</p>
</dd>
<dt>Outputs</dt>
<dd id="_62a88392-7b20-a91f-d396-0a6783ce9ea7"><p id="_869b5503-b533-84b4-47d1-52be6d14a92e"><tt>Y : tensor(float)</tt> — Regression outputs (one score per target per example).</p>
</dd>
<dt>Attributes</dt>
<dd id="_0de0ed83-de7d-6cca-9981-6eb6c870a82e"><p id="_4498ae2d-2384-9db4-4a63-65bedbd6a808"><tt>coefficients : list of floats</tt> — Support vector coefficients.<br/> <tt>kernel_params : list of floats</tt> — List of 3 elements containing gamma, coef0, and degree, in that order. Zero if unused for the kernel.<br/> <tt>kernel_type : string (default is LINEAR)</tt> — The kernel type, one of ‘LINEAR,’ ‘POLY,’ ‘RBF,’ ‘SIGMOID’.<br/> <tt>n_supports : int (default is 0)</tt> — The number of support vectors.<br/> <tt>one_class : int (default is 0)</tt> — Flag indicating whether the regression is a one-class SVM or not.<br/> <tt>post_transform : string (default is NONE)</tt> — Indicates the transform to apply to the score. One of ‘NONE,’ ‘SOFTMAX,’ ‘LOGISTIC,’ ‘SOFTMAX_ZERO,’ or ‘PROBIT.’<br/> <tt>rho : list of floats</tt><br/> <tt>support_vectors : list of floats</tt> — Chosen support vectors</p>
</dd>
<dt>Type constraints</dt>
<dd id="_ad29e6b7-00f7-7749-a5cc-26fe5633e7ae"><p id="_cc1c3244-f708-4927-5289-090185957c4f"><tt>T : tensor(float), tensor(double), tensor(int64), tensor(int32)</tt> — The input type must be a tensor of a numeric type, either [C] or [N,C].</p>
</dd>
<dt>Test vectors</dt>
<dd id="_ab6131b1-433e-f920-469c-dce19732391e"><p id="_ba487184-6f74-b5cb-5009-888c47d04b70">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_207fe325-5977-6dca-e5e5-9c3b2525d464"><p id="_a2fffa37-8c2b-fb70-133e-9ea7017e952b">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_109d092e-5fee-f6d2-4abf-b6c3ca64331b" anchor="op-ai-onnx-ml-ai.onnx.ml.scaler" obligation="normative">
<title id="_4f171075-a27d-f9d4-ed30-6020c30e2bae">ai.onnx.ml.Scaler</title>
<p id="_093c7bee-8317-f082-2d67-2ef2328d0104">Rescale input data, for example to standardize features by removing the mean and scaling to unit variance.</p>

<dl id="_780876e9-2b31-5a88-421a-d0ffa1c5d86c"><dt>Domain</dt>
<dd id="_4279e314-4a9a-1fd5-a524-10013df66b29"><p id="_6318e1da-01aa-ef10-0374-cf3c72b8691b"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_ac8abb07-fa51-db21-868f-dac2838fa16a"><p id="_0ebd262b-8d26-7c7d-1811-70ce71638530">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_cb5d2c34-b690-66d6-5733-f6af320d5f73"><p id="_0c3b0714-4733-fb89-8c57-7cfa2506cbdb"><tt>X : T</tt> — Data to be scaled.</p>
</dd>
<dt>Outputs</dt>
<dd id="_3b1553ca-e198-8778-8ac8-2215f3aa5ca6"><p id="_b44541e2-1143-3d86-3ac1-e1cde1e9da51"><tt>Y : tensor(float)</tt> — Scaled output data.</p>
</dd>
<dt>Attributes</dt>
<dd id="_3b3132e1-aa3d-d489-d1e4-3ee06b433e75"><p id="_3049f566-cffa-9440-e9c8-ab224df930d3"><tt>offset : list of floats</tt> — First, offset by this.Can be length of features in an [N,F] tensor or length 1, in which case it applies to all features, regardless of dimension count.<br/> <tt>scale : list of floats</tt> — Second, multiply by this.Can be length of features in an [N,F] tensor or length 1, in which case it applies to all features, regardless of dimension count.Must be same length as ‘offset’</p>
</dd>
<dt>Type constraints</dt>
<dd id="_fa967e76-5229-6a76-614a-55b680933677"><p id="_df83f004-bac3-c4e4-e831-a1938406341b"><tt>T : tensor(float), tensor(double), tensor(int64), tensor(int32)</tt> — The input must be a tensor of a numeric type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_5bb6f912-b702-7eab-2447-8371f456cb3f"><p id="_01c4d757-37f9-35f9-c728-578e480e144b">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_b7596516-b5d0-fec8-e527-51db8a01faa0"><p id="_b08a4283-2a44-9f25-1254-24212f2a18a6">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_fba193b9-d684-fc16-035a-055a8d190a4e" anchor="op-ai-onnx-ml-ai.onnx.ml.treeensemble" obligation="normative">
<title id="_b76fa215-e50e-60f2-cbe6-f3fcce51338d">ai.onnx.ml.TreeEnsemble</title>
<p id="_0069e114-b039-9495-c296-a96cadcdd640">Tree Ensemble operator.  Returns the regressed values for each input in a batch.     Inputs have dimensions  <tt>[N, F]</tt> where <tt>N</tt> is the input batch size and <tt>F</tt> is the number of input features.     Outputs have dimensions  <tt>[N, num_targets]</tt> where <tt>N</tt> is the batch size and <tt>num_targets</tt> is the number of targets, which is a configurable attribute.</p>

<sourcecode id="_0135da37-190c-9a29-2bcd-186994b9fe48" unnumbered="true"><body>The encoding of this attribute is split along interior nodes and the leaves of the trees. Notably, attributes with the prefix `nodes_*` are associated with interior nodes, and attributes with the prefix `leaf_*` are associated with leaves.
The attributes `nodes_*` must all have the same length and encode a sequence of tuples, as defined by taking all the `nodes_*` fields at a given position.

All fields prefixed with `leaf_*` represent tree leaves, and similarly define tuples of leaves and must have identical length.

This operator can be used to implement both the previous `TreeEnsembleRegressor` and `TreeEnsembleClassifier` nodes.
The `TreeEnsembleRegressor` node maps directly to this node and requires changing how the nodes are represented.
The `TreeEnsembleClassifier` node can be implemented by adding a `ArgMax` node after this node to determine the top class.
To encode class labels, a `LabelEncoder` or `GatherND` operator may be used.</body></sourcecode>


<dl id="_4d2fc1f5-1f49-bf25-9737-05759f68bada"><dt>Domain</dt>
<dd id="_5ffe7630-83ff-5597-4e39-20d5a9c467aa"><p id="_9faaff2b-a7f3-4f05-3263-681e662d423f"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_d686ff5d-24af-384e-23b9-9869f7aaf933"><p id="_0b903f16-2fb8-50c3-1845-60736f4e9af9">5</p>
</dd>
<dt>Inputs</dt>
<dd id="_51419ea5-b1a9-6ff8-d51f-7332c2e87997"><p id="_dffb8030-4475-1fde-d6a1-9adae4ec60ba"><tt>X : T</tt> — Input of shape [Batch Size, Number of Features]</p>
</dd>
<dt>Outputs</dt>
<dd id="_982b06fb-b4bf-24c5-0a74-d86b85290c55"><p id="_77d4e4f9-730d-3ce9-8f84-633a684477aa"><tt>Y : T</tt> — Output of shape [Batch Size, Number of targets]</p>
</dd>
<dt>Attributes</dt>
<dd id="_a2356ce8-48a2-1bc0-67d1-6f48edc79bfd"><p id="_9f091836-54ec-2470-988c-e27b62c7322a"><tt>aggregate_function : int (default is 1)</tt> — Defines how to aggregate leaf values within a target. One of ‘AVERAGE’ (0) ‘SUM’ (1) ‘MIN’ (2) ‘MAX (3) defaults to ‘SUM’ (1)<br/> <tt>leaf_targetids : list of ints (required)</tt> — The index of the target that this leaf contributes to (this must be in range <tt>[0, n_targets)</tt>).<br/> <tt>leaf_weights : tensor (required)</tt> — The weight for each leaf.<br/> <tt>membership_values : tensor</tt> — Members to test membership of for each set membership node. List all of the members to test again in the order that the ‘BRANCH_MEMBER’ mode appears in <tt>node_modes</tt>, delimited by <tt>NaN</tt>s. Will have the same number of sets of values as nodes with mode ‘BRANCH_MEMBER’. This may be omitted if the node doesn’t contain any ‘BRANCH_MEMBER’ nodes.<br/> <tt>n_targets : int</tt> — The total number of targets.<br/> <tt>nodes_falseleafs : list of ints (required)</tt> — 1 if false branch is leaf for each node and 0 if an interior node. To represent a tree that is a leaf (only has one node), one can do so by having a single <tt>nodes_*</tt> entry with true and false branches referencing the same <tt>leaf_*</tt> entry<br/> <tt>nodes_falsenodeids : list of ints (required)</tt> — If <tt>nodes_falseleafs</tt> is false at an entry, this represents the position of the false branch node. This position can be used to index into a <tt>nodes_*</tt> entry. If <tt>nodes_falseleafs</tt> is false, it is an index into the leaf_* attributes.<br/> <tt>nodes_featureids : list of ints (required)</tt> — Feature id for each node.<br/> <tt>nodes_hitrates : tensor</tt> — Popularity of each node, used for performance and may be omitted.<br/> <tt>nodes_missing_value_tracks_true : list of ints</tt> — For each node, define whether to follow the true branch (if attribute value is 1) or false branch (if attribute value is 0) in the presence of a NaN input feature. This attribute may be left undefined and the default value is false (0) for all nodes.<br/> <tt>nodes_modes : tensor (required)</tt> — The comparison operation performed by the node. This is encoded as an enumeration of 0 (’BRANCH_LEQ’), 1 (’BRANCH_LT’), 2 (’BRANCH_GTE’), 3 (’BRANCH_GT’), 4 (’BRANCH_EQ’), 5 (’BRANCH_NEQ’), and 6 (’BRANCH_MEMBER’). Note this is a tensor of type uint8.<br/> <tt>nodes_splits : tensor (required)</tt> — Thresholds to do the splitting on for each node with mode that is not ‘BRANCH_MEMBER’.<br/> <tt>nodes_trueleafs : list of ints (required)</tt> — 1 if true branch is leaf for each node and 0 an interior node. To represent a tree that is a leaf (only has one node), one can do so by having a single <tt>nodes_*</tt> entry with true and false branches referencing the same <tt>leaf_*</tt> entry<br/> <tt>nodes_truenodeids : list of ints (required)</tt> — If <tt>nodes_trueleafs</tt> is false at an entry, this represents the position of the true branch node. This position can be used to index into a <tt>nodes_*</tt> entry. If <tt>nodes_trueleafs</tt> is false, it is an index into the leaf_* attributes.<br/> <tt>post_transform : int (default is 0)</tt> — Indicates the transform to apply to the score. One of ‘NONE’ (0), ‘SOFTMAX’ (1), ‘LOGISTIC’ (2), ‘SOFTMAX_ZERO’ (3) or ‘PROBIT’ (4), defaults to ‘NONE’ (0)<br/> <tt>tree_roots : list of ints (required)</tt> — Index into <tt>nodes_*</tt> for the root of each tree. The tree structure is derived from the branching of each node.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_11604a0c-fb4d-a4c5-196d-5238c664dbc3"><p id="_991a0501-22dc-3b76-bd5a-ec4523c338e5"><tt>T : tensor(float), tensor(double), tensor(float16)</tt> — The input type must be a tensor of a numeric type.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_a0eaacb1-96db-a22c-2141-b7cea87f77d1"><p id="_3939422f-acd1-feee-7975-0a0f3c7bf4f9"><tt>test_ai_onnx_ml_tree_ensemble_set_membership</tt>, <tt>test_ai_onnx_ml_tree_ensemble_single_tree</tt></p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_13f061ee-bc47-4a49-a176-a2df875c692b"><p id="_69edae5c-ce14-1b8e-6a2a-cdc3b8b9192a">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_2a7cf692-3f57-ebd5-64d8-2c03934ca173" anchor="op-ai-onnx-ml-ai.onnx.ml.treeensembleclassifier" obligation="normative">
<title id="_038bbf37-4330-03a6-5964-e8d225985cc9">ai.onnx.ml.TreeEnsembleClassifier</title>
<p id="_a6590d04-1ee3-ee0e-631b-b76eb3e029ff">This operator is DEPRECATED. Please use TreeEnsemble with provides similar functionality.     In order to determine the top class, the ArgMax node can be applied to the output of TreeEnsemble.     To encode class labels, use a LabelEncoder operator.     Tree Ensemble classifier. Returns the top class for each of N inputs.</p>

<sourcecode id="_372ecd04-a1b4-7508-d23e-4cf1f82d306d" unnumbered="true"><body>The attributes named 'nodes_X' form a sequence of tuples, associated by
index into the sequences, which must all be of equal length. These tuples
define the nodes.

Similarly, all fields prefixed with 'class_' are tuples of votes at the leaves.
A leaf may have multiple votes, where each vote is weighted by
the associated class_weights index.

One and only one of classlabels_strings or classlabels_int64s
will be defined. The class_ids are indices into this list.
All fields ending with __as_tensor_ can be used instead of the
same parameter without the suffix if the element type is double and not float.</body></sourcecode>


<dl id="_18795a91-2f71-c673-1a64-e289e09487c0"><dt>Domain</dt>
<dd id="_4240aff2-74f7-c91d-9caa-0397aacaf407"><p id="_175ad2f8-35ac-99b7-00ac-df4492f5a845"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_18baad6a-e06c-d80b-f448-db3dd69137ae"><p id="_fbee0d7d-a4ac-f8df-0c30-a8df9abe289c">5</p>
</dd>
<dt>Status</dt>
<dd id="_b46cb24d-1097-9910-7682-b575aa21b23f"><p id="_87794f08-b2a1-1d79-6449-824c58e572a6">Deprecated. Clause 14.5 of <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/> applies: a deprecated operator is not removed, and a consumer continues to evaluate it.</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_33b30b5c-f845-dae5-7b4c-bd749ce45a09"><p id="_396065e4-d847-658a-d071-0f12caaa4bbb">1, 3</p>
</dd>
<dt>Inputs</dt>
<dd id="_76f61c1b-f882-0b75-f989-65fc681a9d4f"><p id="_44105dee-a824-e323-bc29-62ee2493dca7">Not stated by the source.</p>
</dd>
<dt>Outputs</dt>
<dd id="_f42aecba-d6ca-066c-01cf-25a2b646bdbc"><p id="_cce96dce-d73b-a074-9278-95237a942ddf">Not stated by the source.</p>
</dd>
<dt>Attributes</dt>
<dd id="_9978eb3b-59b5-40d4-416e-8578cb13c344"><p id="_6ea62fcd-1096-1185-a5cb-fb5c4bc2bf04">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_e9cc516e-85e8-cbd9-66b4-6a96c73a29ce"><p id="_f953c9ac-f36a-1103-4e95-e02001b2558d">Not stated by the source.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_432d7267-9564-4603-5c1e-a4bd401c7b7e"><p id="_c2274ac0-6657-f151-0484-696d38100ba8">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_de6c9002-66d3-f248-603b-ee5d69a307cd"><p id="_343d2b2d-1fed-10ec-3b27-af64e1292ed0">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_f4edc55f-812e-ac42-468a-6e04ba4279dc" anchor="op-ai-onnx-ml-ai.onnx.ml.treeensembleregressor" obligation="normative">
<title id="_e3650360-5e1d-da7c-46b8-4d14071d28dd">ai.onnx.ml.TreeEnsembleRegressor</title>
<p id="_40c9dfb7-1c97-4977-cf09-adb9718523df">This operator is DEPRECATED. Please use TreeEnsemble instead which provides the same     functionality.</p>

<sourcecode id="_a023e943-542b-5a55-919b-bd0dd9c74374" unnumbered="true"><body>Tree Ensemble regressor.  Returns the regressed values for each input in N.

All args with nodes_ are fields of a tuple of tree nodes, and
it is assumed they are the same length, and an index i will decode the
tuple across these inputs.  Each node id can appear only once
for each tree id.

All fields prefixed with target_ are tuples of votes at the leaves.

A leaf may have multiple votes, where each vote is weighted by
the associated target_weights index.

All fields ending with __as_tensor_ can be used instead of the
same parameter without the suffix if the element type is double and not float.
All trees must have their node ids start at 0 and increment by 1.

Mode enum is BRANCH_LEQ, BRANCH_LT, BRANCH_GTE, BRANCH_GT, BRANCH_EQ, BRANCH_NEQ, LEAF</body></sourcecode>


<dl id="_cc138726-8496-b945-9703-5c9f6f45dd9a"><dt>Domain</dt>
<dd id="_bfc356c2-f35b-12e9-5e91-0adb4ee028f2"><p id="_602e1ed2-9360-7608-6f98-16c8ba23c248"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_a64fe58a-f9d9-141e-8d58-ecba5a14256c"><p id="_03389be5-49e2-af70-953d-116c6a84be31">5</p>
</dd>
<dt>Status</dt>
<dd id="_2ed382fc-70cb-fbb6-3333-82a9c28207ff"><p id="_5641d305-a28a-ddb6-62e4-2fbac3dada78">Deprecated. Clause 14.5 of <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/> applies: a deprecated operator is not removed, and a consumer continues to evaluate it.</p>
</dd>
<dt>Earlier versions</dt>
<dd id="_a990b75c-6250-dfcf-843f-740690658aad"><p id="_d53c6619-48a8-e6a9-1761-958d45943946">1, 3</p>
</dd>
<dt>Inputs</dt>
<dd id="_e8e02ca6-01c7-d2aa-789f-e1673571384d"><p id="_ef35a130-a7d9-7601-c94b-837dcc887048">Not stated by the source.</p>
</dd>
<dt>Outputs</dt>
<dd id="_3c8edf3e-2206-3807-1c61-8549448cb533"><p id="_4bbd2927-ef9b-4600-5bbc-31ff81da24be">Not stated by the source.</p>
</dd>
<dt>Attributes</dt>
<dd id="_88f2d964-e8a6-f226-8a63-ec3af4ba5035"><p id="_206415f2-f1c5-0a69-0e0b-32de241f287a">None.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_94ac657d-e050-0c10-ccc9-defec1fbf80e"><p id="_9044b264-eca0-a1c9-6dd5-a5f95122b78a">Not stated by the source.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_91a27a7c-e87d-39d1-90c9-004e768406ca"><p id="_c71772fa-3bad-e941-692c-2b14cdb681d9">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_8675d303-9312-6799-e9ad-a5775b10c90c"><p id="_35f6b43f-affe-6eca-d984-f7b92e4441a8">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>

<clause id="_d792e378-f2be-c5dc-9cd5-61feb09be4ed" anchor="op-ai-onnx-ml-ai.onnx.ml.zipmap" obligation="normative">
<title id="_2053b489-05f8-117a-ecb2-b67dd6d572fc">ai.onnx.ml.ZipMap</title>
<p id="_c5855297-c5b8-fee7-237b-ab571dd8c61f">Creates a map from the input and the attributes.</p>

<sourcecode id="_9c47428c-e778-dfdb-a698-d7b8df0f7a63" unnumbered="true"><body>The values are provided by the input tensor, while the keys are specified by the attributes.
Must provide keys in either classlabels_strings or classlabels_int64s (but not both).

The columns of the tensor correspond one-by-one to the keys specified by the attributes. There must be as many columns as keys.</body></sourcecode>


<dl id="_990c7d60-d315-a22e-46a2-b8a0aced8b9a"><dt>Domain</dt>
<dd id="_8a146304-473b-2d07-9222-c14d00d8c807"><p id="_3e3ff8a7-9ee7-fe49-f71a-06e1f2d0da4b"><tt>ai.onnx.ml</tt></p>
</dd>
<dt>Since version</dt>
<dd id="_3ce60a59-85aa-4eec-8f5b-584da3ea59e3"><p id="_acd02fa2-a62e-b591-3835-ac1cc513d75f">1</p>
</dd>
<dt>Inputs</dt>
<dd id="_1dabce06-6ed9-ab9d-8a15-dba1a0a55ed6"><p id="_d63eab7c-858d-8308-b59d-f4710ff09899"><tt>X : tensor(float)</tt> — The input values</p>
</dd>
<dt>Outputs</dt>
<dd id="_93417c39-158a-4d37-f01b-21f50b9a9d9d"><p id="_c9dea870-d9cc-21e3-bb40-118b3550dacf"><tt>Z : T</tt> — The output map</p>
</dd>
<dt>Attributes</dt>
<dd id="_2c7ca14e-4770-8d01-397b-04473688a2d0"><p id="_844ebe34-02e4-505b-b5c2-f05921681510"><tt>classlabels_int64s : list of ints</tt> — The keys when using int keys.One and only one of the ‘classlabels_*’ attributes must be defined.<br/> <tt>classlabels_strings : list of strings</tt> — The keys when using string keys.One and only one of the ‘classlabels_*’ attributes must be defined.</p>
</dd>
<dt>Type constraints</dt>
<dd id="_c62e5000-7aa6-c502-ae37-728e1c34d8f7"><p id="_32ff6869-0d0d-cf50-9c35-f2fc071f43ee"><tt>T : seq(map(string, float)), seq(map(int64, float))</tt> — The output will be a sequence of string or integer maps to float.</p>
</dd>
<dt>Test vectors</dt>
<dd id="_37552586-a680-6268-63ac-390d2654ec10"><p id="_1834c515-6e73-180f-821d-4750961af27f">None published for this operator.</p>
</dd>
<dt>Not supplied by the upstream source</dt>
<dd id="_e3b44cc6-18d2-3d9d-e606-1f38a053ae23"><p id="_d85d818d-f39f-d222-2bd5-322c8066e66c">Shape inference, determinism, errors. See the editorial note at the head of this clause.</p>
</dd>
</dl>
</clause>
</clause>






</sections><annex id="_bfa92bcb-2d0e-a390-4a72-95a7d1ae038f" obligation="normative">
<title id="_89cbf7f4-a983-3c1e-5ada-a85c17f602ff">Operator registry</title>
<p id="_5118392d-40cc-2683-16d4-7f31e4ceb9b2">This annex lists every operator of every domain specified by this document, with the operator set versions in which each definition took effect, as an index into the clauses above.</p>

<admonition id="_926bf5d7-ff0b-1855-0eb0-d1e3a49cd9a6" type="important">
<name id="_48ee5a5a-99dc-ce16-47fe-21382ca1229c">Editorial note</name>
<p id="_58fd378e-7972-c95c-75b8-f227ca7b4d8c">The registry is the machine-readable face of this part: a table of domain, operator, and the versions at which a definition exists. It is what a validating consumer checks a node against under Clause 10 of  <eref type="inline" bibitemid="onnx-part-1" citeas="ONNX 1-1"/>, and what a conformance statement enumerates when it lists unsupported operators.</p>

<p id="_eeb03b38-8e4a-b254-8e8c-a35ec7e58576">It is to be generated together with the clauses it indexes, not maintained separately; a registry that can drift from the definitions is worse than none.</p>
</admonition></annex><annex id="_dfcf59a0-1eec-df59-6bc3-caf6f83a87ac" obligation="informative">
<title id="_08676f88-4a36-f2c1-1d8f-0a87ed6ae378">Changelog</title>
<p id="_33b11814-3fbc-cf69-8e41-063c9cd479df">This annex records, for each operator set version, the operators added, the operators given a new definition, and the type constraints widened.</p>

<admonition id="_67f9d227-f096-0622-9d8d-ce07f2494baf" type="important">
<name id="_4d580390-a6e5-e19e-8f4c-8d1558e27ba4">Editorial note</name>
<p id="_b3e76d09-4879-dc71-b513-59d98ff101a8">To be generated from the registry in Annex A by comparing consecutive operator set versions, rather than maintained by hand. Upstream keeps an equivalent changelog; the vendored copy at  <tt>upstream/onnx/docs/Changelog.md</tt> is the material this annex restates.</p>
</admonition></annex><bibliography><references id="_c43f6245-6e8b-f46c-ae55-de7db62a0361" normative="true" obligation="informative">
<title id="_270c5ee6-077e-f285-ff95-287984a30140">Normative references</title><p id="_49996d2b-65c1-916b-9bbf-42b933aa0025">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>


<bibitem anchor="onnx-part-1" id="_3bed526e-25cb-781c-d7d6-23bcc1096c9b"><formattedref format="application/x-isodoc+xml"><em>Open Neural Network Exchange (ONNX) —- Part 1:
Core</em></formattedref><docidentifier>ONNX 1-1</docidentifier><docnumber>1-1</docnumber><language>en</language><script>Latn</script></bibitem>
<bibitem anchor="onnx-part-3" id="_ddece3c8-f516-76bd-57db-cf7b9f890dad"><formattedref format="application/x-isodoc+xml"><em>Open Neural Network Exchange (ONNX) —- Part 3:
Conformance test package</em></formattedref><docidentifier>ONNX 1-3</docidentifier><docnumber>1-3</docnumber><language>en</language><script>Latn</script></bibitem>
<bibitem anchor="ieee754" id="_bdc19ab0-25bb-a5b7-3b45-7436348856f1"><formattedref format="application/x-isodoc+xml"><em>IEEE Standard for Floating-Point Arithmetic</em></formattedref><docidentifier type="IEEE">IEEE 754-2019</docidentifier><docnumber>754</docnumber><date type="published"><on>2019</on></date><language>en</language><script>Latn</script></bibitem>
</references><references id="_f5bfac26-f077-b00c-695d-c9272e2187c8" normative="false" obligation="informative">
<title id="_50ceb1e1-516f-2673-d73d-4f0c58b4d023">Bibliography</title><bibitem anchor="onnxrepo" id="_59cd5a5f-6f1c-4af7-e50e-4878ff7cc389">
  <formattedref format="application/x-isodoc+xml"><em>Open Neural Network Exchange</em>, <link target="https://onnx.ai"/></formattedref>
  <docidentifier>ONNX</docidentifier>
  <language>en</language>
  <script>Latn</script>
</bibitem>

</references></bibliography>
</metanorma>
