onnxruntime/docs/api/csharp/api/Microsoft.ML.OnnxRuntime.Tensors.BFloat16.html
github-actions[bot] e2573f4801
[Automated]: Update C# API docs (#12807)
Update C# API docs to commit 98b2b7f

Co-authored-by: natke <natke@users.noreply.github.com>
2022-09-02 09:14:15 -05:00

510 lines
18 KiB
HTML

<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Struct BFloat16
</title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Struct BFloat16
">
<meta name="generator" content="docfx 2.59.3.0">
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" href="../styles/docfx.vendor.css">
<link rel="stylesheet" href="../styles/docfx.css">
<link rel="stylesheet" href="../styles/main.css">
<meta property="docfx:navrel" content="../toc.html">
<meta property="docfx:tocrel" content="toc.html">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../logo.svg" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16">
<h1 id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16" class="text-break">Struct BFloat16
</h1>
<div class="markdown level0 summary"><p>This value type represents A BFloat16 value
it is blittable as defined in <a href="https://docs.microsoft.com/en-us/dotnet/framework/interop/blittable-and-non-blittable-types">https://docs.microsoft.com/en-us/dotnet/framework/interop/blittable-and-non-blittable-types</a>
and as such, represented the same way in managed and native memories. This means that arrays of this type
do not have to be copied to be passed to native memory but simply pinnned and read by native code. Thus,
one can create a Tensor on top of an array of these structures and feed it directly to Onnxruntime library.
Binary wise, it is the same as ushort[] (uint16_t in C++). However, we would like a separate type for type dispatching.</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
<div>
<span class="xref">System.ValueType.ToString()</span>
</div>
<div>
<span class="xref">System.Object.Equals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.GetType()</span>
</div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="Microsoft.ML.OnnxRuntime.Tensors.html">Microsoft.ML.OnnxRuntime.Tensors</a></h6>
<h6><strong>Assembly</strong>: cs.temp.dll.dll</h6>
<h5 id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public struct BFloat16</code></pre>
</div>
<h3 id="constructors">Constructors
</h3>
<a id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16__ctor_" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.#ctor*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16__ctor_System_UInt16_" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.#ctor(System.UInt16)">BFloat16(UInt16)</h4>
<div class="markdown level1 summary"><p>Ctor</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public BFloat16(ushort v)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.UInt16</span></td>
<td><span class="parametername">v</span></td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="fields">Fields
</h3>
<h4 id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_value" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.value">value</h4>
<div class="markdown level1 summary"><p>bfloat16 representation bits</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public ushort value</code></pre>
</div>
<h5 class="fieldValue">Field Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.UInt16</span></td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="methods">Methods
</h3>
<a id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_Equals_" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.Equals*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_Equals_Microsoft_ML_OnnxRuntime_Tensors_BFloat16_" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.Equals(Microsoft.ML.OnnxRuntime.Tensors.BFloat16)">Equals(BFloat16)</h4>
<div class="markdown level1 summary"><p>Returns a value indicating whether this instance and other BFloat16 represent the same value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public bool Equals(BFloat16 other)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.html">BFloat16</a></td>
<td><span class="parametername">other</span></td>
<td><p>A BFloat16 object to compare to this instance.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p>true if other.value is equal to this instance; otherwise, false.</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_Equals_" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.Equals*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_Equals_System_Object_" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.Equals(System.Object)">Equals(Object)</h4>
<div class="markdown level1 summary"><p>Returns a value indicating whether this instance and a specified System.Object
represent the same type and value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public override bool Equals(object obj)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Object</span></td>
<td><span class="parametername">obj</span></td>
<td><p>An System.Object.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p>true if obj is BFloat16 its value is equal to this instance; otherwise, false.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="overrides">Overrides</h5>
<div><span class="xref">System.ValueType.Equals(System.Object)</span></div>
<a id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_GetHashCode_" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.GetHashCode*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_GetHashCode" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.GetHashCode">GetHashCode()</h4>
<div class="markdown level1 summary"><p>Returns the hash code for this instance.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public override int GetHashCode()</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><p>A 32-bit signed integer hash code.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="overrides">Overrides</h5>
<div><span class="xref">System.ValueType.GetHashCode()</span></div>
<h3 id="operators">Operators
</h3>
<a id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_op_Equality_" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.op_Equality*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_op_Equality_Microsoft_ML_OnnxRuntime_Tensors_BFloat16_Microsoft_ML_OnnxRuntime_Tensors_BFloat16_" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.op_Equality(Microsoft.ML.OnnxRuntime.Tensors.BFloat16,Microsoft.ML.OnnxRuntime.Tensors.BFloat16)">Equality(BFloat16, BFloat16)</h4>
<div class="markdown level1 summary"><p>Compares values of two BFloat16 for binary equality</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool operator ==(BFloat16 lhs, BFloat16 rhs)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.html">BFloat16</a></td>
<td><span class="parametername">lhs</span></td>
<td></td>
</tr>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.html">BFloat16</a></td>
<td><span class="parametername">rhs</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p>result of value comparisons</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_op_Implicit_" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.op_Implicit*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_op_Implicit_Microsoft_ML_OnnxRuntime_Tensors_BFloat16__System_UInt16" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.op_Implicit(Microsoft.ML.OnnxRuntime.Tensors.BFloat16)~System.UInt16">Implicit(BFloat16 to UInt16)</h4>
<div class="markdown level1 summary"><p>Converts to ushort</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static implicit operator ushort (BFloat16 bf)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.html">BFloat16</a></td>
<td><span class="parametername">bf</span></td>
<td><p>instance of BFloat16</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.UInt16</span></td>
<td><p>value member</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_op_Implicit_" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.op_Implicit*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_op_Implicit_System_UInt16__Microsoft_ML_OnnxRuntime_Tensors_BFloat16" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.op_Implicit(System.UInt16)~Microsoft.ML.OnnxRuntime.Tensors.BFloat16">Implicit(UInt16 to BFloat16)</h4>
<div class="markdown level1 summary"><p>Converts a 16-bit unsigned integer to a BFloat16.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static implicit operator BFloat16(ushort value)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.UInt16</span></td>
<td><span class="parametername">value</span></td>
<td><p>A 16-bit unsigned integer.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.html">BFloat16</a></td>
<td><p>A BFloat16 that represents the converted 16-bit unsigned integer.</p>
</td>
</tr>
</tbody>
</table>
<a id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_op_Inequality_" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.op_Inequality*"></a>
<h4 id="Microsoft_ML_OnnxRuntime_Tensors_BFloat16_op_Inequality_Microsoft_ML_OnnxRuntime_Tensors_BFloat16_Microsoft_ML_OnnxRuntime_Tensors_BFloat16_" data-uid="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.op_Inequality(Microsoft.ML.OnnxRuntime.Tensors.BFloat16,Microsoft.ML.OnnxRuntime.Tensors.BFloat16)">Inequality(BFloat16, BFloat16)</h4>
<div class="markdown level1 summary"><p>Compares values of two BFloat16 for binary inequality</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool operator !=(BFloat16 lhs, BFloat16 rhs)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.html">BFloat16</a></td>
<td><span class="parametername">lhs</span></td>
<td></td>
</tr>
<tr>
<td><a class="xref" href="Microsoft.ML.OnnxRuntime.Tensors.BFloat16.html">BFloat16</a></td>
<td><span class="parametername">rhs</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p>result of value comparisons</p>
</td>
</tr>
</tbody>
</table>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<h5>In This Article</h5>
<div></div>
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="../styles/docfx.vendor.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/main.js"></script>
</body>
</html>