Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.html
More file actions
Latest commit
295 lines (276 loc) · 25.2 KB
/
Copy pathinstall.html
File metadata and controls
295 lines (276 loc) · 25.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<!DOCTYPE html>
<htmllang="en">
<head>
<metacharset="utf-8">
<title>Installing
</title>
<metaname="viewport" content="width=device-width, initial-scale=1.0">
<metaname="author" content="Atılım Güneş Baydin, Don Syme, Barak A. Pearlmutter, Jeffrey Siskind, and DiffSharp contributors">
<metaname="description" content="DiffSharp is a tensor library with support for differentiable programming. It is designed for use in machine learning, probabilistic programming, optimization and other domains.">
<scriptsrc="https://code.jquery.com/jquery-1.8.0.js"></script>
<scriptsrc="https://code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<scriptsrc="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<scripttype="text/javascript" asyncsrc="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<linkhref="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">
<linktype="text/css" rel="stylesheet" href="https://diffsharp.github.io/content/fsdocs-default.css" />
<scriptsrc="https://diffsharp.github.io/content/fsdocs-tips.js" type="text/javascript"></script>
<!-- BEGIN SEARCH BOX: this adds support for the search box -->
<linkrel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/JavaScript-autoComplete/1.0.4/auto-complete.css" />
<!-- END SEARCH BOX: this adds support for the search box -->
</head>
<body>
<divclass="container">
<!-- <div class="masthead">
<ul class="nav nav-pills pull-right">
<li><a href="https://fsharp.org">fsharp.org</a></li>
</ul>
<h3 class="muted">DiffSharp</h3>
</div> -->
<!-- <hr /> -->
<divclass="row">
<divclass="col-xs-12" style="height:10px;"></div>
</div>
<divclass="row">
<divclass="span3" id="fsdocs-nav">
<ahref="index.html"><imgclass="logo" src="https://diffsharp.github.io/img/diffsharp-logo-text.png"/></a>
<!-- BEGIN SEARCH BOX: this adds support for the search box -->
<divid="header">
<divclass="searchbox">
<labelfor="search-by">
<iclass="fas fa-search"></i>
</label>
<inputdata-search-input="" id="search-by" type="search" placeholder="Search..." />
<spandata-search-clear="">
<iclass="fas fa-times"></i>
</span>
</div>
</div>
<!-- END SEARCH BOX: this adds support for the search box -->
<ulclass="nav nav-list" id="menu">
<!-- <li class="nav-header">DiffSharp</li> -->
<!-- <li class="divider"></li> -->
<li><ahref="https://diffsharp.github.io/index.html">Home</a></li>
<li><ahref="https://github.com/DiffSharp/DiffSharp/">GitHub</a></li>
<li><ahref="https://github.com/DiffSharp/DiffSharp/blob/dev/LICENSE">License (BSD)</a></li>
<liclass="nav-header">Getting Started</li>
<!-- <li class="divider"></li> -->
<li><ahref="https://diffsharp.github.io/install.html">Install</a></li>
<li><ahref="https://diffsharp.github.io/quickstart.html">Quickstart</a></li>
<!-- <li><a href="https://diffsharp.github.io/tensors.html">Tensors</a></li> -->
<!-- <li><a href="https://diffsharp.github.io/differentiable-programming.html">Differentiable Programming</a></li> -->
<!-- <li><a href="https://diffsharp.github.io/nested-derivatives.html">Nested Derivatives</a></li> -->
<!-- <li><a href="https://diffsharp.github.io/models.html">Models</a></li> -->
<!-- <li><a href="https://diffsharp.github.io/optimization.html">Optimization</a></li> -->
<!-- <li><a href="https://diffsharp.github.io/probability-distributions.html">Probability Distributions</a></li> -->
<liclass="nav-header">Tutorials</li>
<!-- <li class="divider"></li> -->
<!-- <li><a href="https://diffsharp.github.io/tutorial-classifier.html">Classifier</a></li> -->
<!-- <li><a href="https://diffsharp.github.io/tutorial-gan.html">GAN</a></li> -->
<!-- <li><a href="https://diffsharp.github.io/tutorial-vae.html">VAE</a></li> -->
<!-- <li><a href="https://diffsharp.github.io/tutorial-language.html">Language Models</a></li> -->
<li><ahref="https://github.com/DiffSharp/DiffSharp/tree/dev/examples">More Examples</a></li>
<liclass="nav-header">API Documentation</li>
<li><ahref="https://diffsharp.github.io/reference/index.html">API Reference</a></li>
<li><ahref="https://diffsharp.github.io/extensions.html">Extensions</a></li>
<!-- <li class="nav-header">Examples</li> -->
<!-- <li class="divider"></li> -->
<!-- <li class="nav-header">Machine Learning</li> -->
<!-- <li><a href="https://diffsharp.github.io/examples-topic1.html">Topic 1</a></li> -->
<!-- <li class="divider"></li>
<li class="nav-header">Authors</li>
<li><a href="http://www.robots.ox.ac.uk/~gunes/">Atılım Güneş Baydin</a></li>
<li><a href="http://www.bcl.hamilton.ie/~barak/">Barak A. Pearlmutter</a></li>
<li><a href="https://www.microsoft.com/en-us/research/people/dsyme/">Don Syme</a></li> -->
</ul>
</div>
<divclass="span9" id="fsdocs-content">
<p><ahref="https://colab.research.google.com/github/DiffSharp/diffsharp.github.io/blob/master/install.ipynb"><imgsrc="https://colab.research.google.com/assets/colab-badge.svg" alt="Binder" /></a> 
<ahref="https://mybinder.org/v2/gh/diffsharp/diffsharp.github.io/master?filepath=install.ipynb"><imgsrc="img/badge-binder.svg" alt="Binder" /></a> 
<ahref="install.fsx"><imgsrc="img/badge-script.svg" alt="Script" /></a> 
<ahref="install.ipynb"><imgsrc="img/badge-notebook.svg" alt="Script" /></a></p>
<h1><aname="Installing" class="anchor" href="#Installing">Installing</a></h1>
<p>DiffSharp runs on <ahref="https://dotnet.microsoft.com/">dotnet</a>, a cross-platform, open-source platform supported on Linux, macOS, and Windows.</p>
<p>There are various ways in which you can run DiffSharp, the main ones being: <ahref="https://github.com/dotnet/interactive">interactive notebooks</a> supporting <ahref="https://code.visualstudio.com/">Visual Studio Code</a> and <ahref="https://jupyter.org/">Jupyter</a>; running in a <ahref="https://github.com/jonsequitur/dotnet-repl">REPL</a>; running <ahref="https://docs.microsoft.com/en-us/dotnet/fsharp/tools/fsharp-interactive/">script files</a>; and <ahref="https://docs.microsoft.com/en-us/dotnet/core/introduction">compiling, packing, and publishing</a> performant binaries.</p>
<h2><aname="Interactive-Notebooks-and-Scripts" class="anchor" href="#Interactive-Notebooks-and-Scripts">Interactive Notebooks and Scripts</a></h2>
<p>You can use DiffSharp in <ahref="https://github.com/dotnet/interactive">dotnet interactive</a> notebooks in <ahref="https://code.visualstudio.com/">Visual Studio Code</a> or <ahref="https://jupyter.org/">Jupyter</a>, or in F# scripts (<code>.fsx</code> files), by referencing the package as follows:</p>
<preclass="fssnip highlighted"><codelang="fsharp"><spanclass="c">// Use one of the following three lines</span>
<spanclass="pp">#r</span><spanclass="s">"nuget: DiffSharp-cpu"</span><spanclass="c">// Use the latest version</span>
<spanclass="pp">#r</span><spanclass="s">"nuget: DiffSharp-cpu, *-*"</span><spanclass="c">// Use the latest pre-release version</span>
<spanclass="pp">#r</span><spanclass="s">"nuget: DiffSharp-cpu, 1.0.1"</span><spanclass="c">// Use a specific version</span>
<spanclass="k">open</span><spanonmouseout="hideTip(event, 'fs1', 10)" onmouseover="showTip(event, 'fs1', 10)" class="id">DiffSharp</span>
</code></pre>
</br>
<imgsrc="img/anim-intro-1.gif" width="85%" />
<h2><aname="Dotnet-Applications" class="anchor" href="#Dotnet-Applications">Dotnet Applications</a></h2>
<p>You can add DiffSharp to your dotnet application using the <ahref="https://dotnet.microsoft.com/">dotnet</a> command-line interface (CLI).</p>
<p>For example, the following creates a new F# console application and adds the latest pre-release version of the <code>DiffSharp-cpu</code> package as a dependency.</p>
<preclass="fssnip highlighted"><codelang="fsharp"><spanclass="id">dotnet</span><spanclass="k">new</span><spanclass="id">console</span><spanclass="o">-</span><spanclass="id">lang</span><spanclass="s">"F#"</span><spanclass="o">-</span><spanclass="id">o</span><spanclass="id">src</span><spanclass="o">/</span><spanclass="id">app</span>
<spanclass="id">cd</span><spanclass="id">src</span><spanclass="o">/</span><spanclass="id">app</span>
<spanclass="id">dotnet</span><spanclass="id">add</span><spanclass="id">package</span><spanclass="o">--</span><spanclass="id">prerelease</span><spanonmouseout="hideTip(event, 'fs1', 11)" onmouseover="showTip(event, 'fs1', 11)" class="id">DiffSharp</span><spanclass="o">-</span><spanclass="id">cpu</span>
<spanclass="id">dotnet</span><spanclass="id">run</span>
</code></pre>
<h2><aname="Packages" class="anchor" href="#Packages">Packages</a></h2>
<p>We provide several package bundles for a variety of use cases.</p>
<ul>
<li>
<ahref="https://www.nuget.org/packages/DiffSharp-cpu">DiffSharp-cpu</a></br>
Includes LibTorch CPU binaries for Linux, macOS, and Windows.
</li>
<li>
<ahref="https://www.nuget.org/packages/DiffSharp-cuda-linux">DiffSharp-cuda-linux</a> / <ahref="https://www.nuget.org/packages/DiffSharp-cuda-windows">DiffSharp-cuda-windows</a></br>
Include LibTorch CPU and CUDA GPU binaries for Linux and Windows. Large download.
</li>
<li>
<ahref="https://www.nuget.org/packages/DiffSharp-lite">DiffSharp-lite</a></br>
Includes the Torch backend but not the LibTorch binaries.
</li>
</ul>
<h3><aname="Using-local-LibTorch-binaries-optional" class="anchor" href="#Using-local-LibTorch-binaries-optional">Using local LibTorch binaries (optional)</a></h3>
<p>You can combine the <code>DiffSharp-lite</code> package bundle with existing local native binaries of LibTorch for your OS (Linux, Mac, or Windows) installed through other means.</p>
<p>LibTorch is the main tensor computation core implemented in C++/CUDA and it is used by PyTorch in Python and by other projects in various programming languages. The following are two common ways of having LibTorch in your system.</p>
<ul>
<li>If you use Python and have <ahref="https://pytorch.org/">PyTorch</a> installed, this comes with LibTorch as a part of the PyTorch distribution. If your GPU works in this PyTorch installation without any issues, it will also work in DiffSharp.</li>
<li>You can download the native LibTorch package without Python by following the <ahref="https://pytorch.org/get-started/locally/">get started</a> instructions in the PyTorch website, and extracting the downloaded archive to a folder in your system.</li>
</ul>
<p>Before using the <code>Torch</code> backend in DiffSharp, you will have to add an explicit load of the LibTorch native library, which you can do as follows. In order to find the location of LibTorch binaries, searching for <code>libtorch.so</code> in your system might be helpful. Note that this file is called <code>libtorch.so</code> in Linux, <code>libtorch.dylib</code> in macOS, and <code>torch.dll</code> in Windows.</p>
<preclass="fssnip highlighted"><codelang="fsharp"><spanclass="k">open</span><spanonmouseout="hideTip(event, 'fs7', 12)" onmouseover="showTip(event, 'fs7', 12)" class="id">System</span><spanclass="pn">.</span><spanonmouseout="hideTip(event, 'fs8', 13)" onmouseover="showTip(event, 'fs8', 13)" class="id">Runtime</span><spanclass="pn">.</span><spanonmouseout="hideTip(event, 'fs9', 14)" onmouseover="showTip(event, 'fs9', 14)" class="id">InteropServices</span>
<spanclass="id">NativeLibrary</span><spanclass="pn">.</span><spanclass="id">Load</span><spanclass="pn">(</span><spanclass="s">"/home/user/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch.so"</span><spanclass="pn">)</span>
</code></pre>
<h2><aname="Backends-and-Devices" class="anchor" href="#Backends-and-Devices">Backends and Devices</a></h2>
<p>DiffSharp currently provides two computation backends.</p>
<ul>
<li><p>The <code>Torch</code> backend is the default and recommended backend based on <ahref="https://pytorch.org/cppdocs/">LibTorch</a>, using the same C++ and CUDA implementations for tensor computations that power <ahref="https://pytorch.org/">PyTorch</a>. On top of these raw tensors (LibTorch's ATen, excluding autograd), DiffSharp implements its own computation graph and differentiation capabilities. This backend requires platform-specific binaries of LibTorch, which we provide and test on Linux, macOS, and Windows.</p></li>
<li><p>The <code>Reference</code> backend is implemented purely in F# and can run on any hardware platform where <ahref="https://dotnet.microsoft.com/">dotnet</a> can run (for example iOS, Android, Raspberry Pi). This backend has reasonable performance for use cases dominated by scalar and small tensor operations, and is not recommended for use cases involving large tensor operations (such as machine learning). This backend is always available.</p></li>
</ul>
<h3><aname="Configuration-of-Default-Backend-Device-and-Tensor-Type" class="anchor" href="#Configuration-of-Default-Backend-Device-and-Tensor-Type">Configuration of Default Backend, Device, and Tensor Type</a></h3>
<p>Selection of the default backend, device, and tensor type is done using <ahref="https://diffsharp.github.io/reference/diffsharp-dsharp.html#config">dsharp.config</a>.</p>
<ul>
<li><p><ahref="https://diffsharp.github.io/reference/diffsharp-dtype.html">Dtype</a> choices available: <code>BFloat16</code>, <code>Bool</code>, <code>Byte</code>, <code>Float16</code>, <code>Float32</code>, <code>Float64</code>, <code>Int16</code>, <code>Int32</code>, <code>Int64</code>, <code>Int8</code></p></li>
<li><p><ahref="https://diffsharp.github.io/reference/diffsharp-device.html">Device</a> choices available: <code>CPU</code>, <code>GPU</code></p></li>
<li><p><ahref="https://diffsharp.github.io/reference/diffsharp-backend.html">Backend</a> choices available: <code>Reference</code>, <code>Torch</code></p></li>
</ul>
<p>For example, the following selects the <code>Torch</code> backend with single precision tensors as the default tensor type and GPU (CUDA) execution.</p>
<preclass="fssnip highlighted"><codelang="fsharp"><spanclass="k">open</span><spanonmouseout="hideTip(event, 'fs1', 15)" onmouseover="showTip(event, 'fs1', 15)" class="id">DiffSharp</span>
<spanonmouseout="hideTip(event, 'fs2', 16)" onmouseover="showTip(event, 'fs2', 16)" class="rt">dsharp</span><spanclass="pn">.</span><spanonmouseout="hideTip(event, 'fs10', 17)" onmouseover="showTip(event, 'fs10', 17)" class="id">config</span><spanclass="pn">(</span><spanclass="fn">dtype</span><spanclass="o">=</span><spanonmouseout="hideTip(event, 'fs11', 18)" onmouseover="showTip(event, 'fs11', 18)" class="m">Dtype</span><spanclass="pn">.</span><spanonmouseout="hideTip(event, 'fs12', 19)" onmouseover="showTip(event, 'fs12', 19)" class="id">Float32</span><spanclass="pn">,</span><spanclass="fn">device</span><spanclass="o">=</span><spanonmouseout="hideTip(event, 'fs13', 20)" onmouseover="showTip(event, 'fs13', 20)" class="m">Device</span><spanclass="pn">.</span><spanonmouseout="hideTip(event, 'fs14', 21)" onmouseover="showTip(event, 'fs14', 21)" class="id">GPU</span><spanclass="pn">,</span><spanclass="fn">backend</span><spanclass="o">=</span><spanonmouseout="hideTip(event, 'fs4', 22)" onmouseover="showTip(event, 'fs4', 22)" class="m">Backend</span><spanclass="pn">.</span><spanonmouseout="hideTip(event, 'fs15', 23)" onmouseover="showTip(event, 'fs15', 23)" class="id">Torch</span><spanclass="pn">)</span>
</code></pre>
<p>The following selects the <code>Reference</code> backend.</p>
<preclass="fssnip highlighted"><codelang="fsharp"><spanonmouseout="hideTip(event, 'fs2', 24)" onmouseover="showTip(event, 'fs2', 24)" class="rt">dsharp</span><spanclass="pn">.</span><spanonmouseout="hideTip(event, 'fs10', 25)" onmouseover="showTip(event, 'fs10', 25)" class="id">config</span><spanclass="pn">(</span><spanclass="fn">backend</span><spanclass="o">=</span><spanonmouseout="hideTip(event, 'fs4', 26)" onmouseover="showTip(event, 'fs4', 26)" class="m">Backend</span><spanclass="pn">.</span><spanonmouseout="hideTip(event, 'fs16', 27)" onmouseover="showTip(event, 'fs16', 27)" class="id">Reference</span><spanclass="pn">)</span>
</code></pre>
<p>A tensor's backend and device can be inspected as follows.</p>
<preclass="fssnip highlighted"><codelang="fsharp"><spanclass="k">let</span><spanonmouseout="hideTip(event, 'fs17', 28)" onmouseover="showTip(event, 'fs17', 28)" class="id">t</span><spanclass="o">=</span><spanonmouseout="hideTip(event, 'fs2', 29)" onmouseover="showTip(event, 'fs2', 29)" class="rt">dsharp</span><spanclass="pn">.</span><spanonmouseout="hideTip(event, 'fs18', 30)" onmouseover="showTip(event, 'fs18', 30)" class="id">tensor</span><spanclass="pn">[</span><spanclass="n">0</span><spanclass="o">..</span><spanclass="n">10</span><spanclass="pn">]</span>
<spanclass="k">let</span><spanonmouseout="hideTip(event, 'fs19', 31)" onmouseover="showTip(event, 'fs19', 31)" class="id">device</span><spanclass="o">=</span><spanonmouseout="hideTip(event, 'fs17', 32)" onmouseover="showTip(event, 'fs17', 32)" class="id">t</span><spanclass="pn">.</span><spanclass="id">device</span>
<spanclass="k">let</span><spanonmouseout="hideTip(event, 'fs20', 33)" onmouseover="showTip(event, 'fs20', 33)" class="id">backend</span><spanclass="o">=</span><spanonmouseout="hideTip(event, 'fs17', 34)" onmouseover="showTip(event, 'fs17', 34)" class="id">t</span><spanclass="pn">.</span><spanclass="id">backend</span>
</code></pre>
<p>Tensors can be moved between devices (for example from CPU to GPU) using <ahref="https://diffsharp.github.io/reference/diffsharp-tensor.html#move">Tensor.move</a>. For example:</p>
<preclass="fssnip highlighted"><codelang="fsharp"><spanclass="k">let</span><spanonmouseout="hideTip(event, 'fs21', 35)" onmouseover="showTip(event, 'fs21', 35)" class="id">t2</span><spanclass="o">=</span><spanonmouseout="hideTip(event, 'fs17', 36)" onmouseover="showTip(event, 'fs17', 36)" class="id">t</span><spanclass="pn">.</span><spanclass="id">move</span><spanclass="pn">(</span><spanonmouseout="hideTip(event, 'fs13', 37)" onmouseover="showTip(event, 'fs13', 37)" class="m">Device</span><spanclass="pn">.</span><spanonmouseout="hideTip(event, 'fs14', 38)" onmouseover="showTip(event, 'fs14', 38)" class="id">GPU</span><spanclass="pn">)</span>
</code></pre>
<h2><aname="Developing-DiffSharp-Libraries" class="anchor" href="#Developing-DiffSharp-Libraries">Developing DiffSharp Libraries</a></h2>
<p>To develop libraries built on DiffSharp, you can use the following guideline to reference the various packages.</p>
<ul>
<li>Reference <code>DiffSharp.Core</code> and <code>DiffSharp.Data</code> in your library code.</li>
<li>Reference <code>DiffSharp.Backends.Reference</code> in your correctness testing code.</li>
<li>Reference <code>DiffSharp.Backends.Torch</code> and <code>libtorch-cpu</code> in your CPU testing code.</li>
<li>Reference <code>DiffSharp.Backends.Torch</code> and <code>libtorch-cuda-linux</code> or <code>libtorch-cuda-windows</code> in your (optional) GPU testing code.</li>
</ul>
<divclass="fsdocs-tip" id="fs1">namespace DiffSharp</div>
<divclass="fsdocs-tip" id="fs2">type dsharp =
static member abs: input: Tensor -> Tensor
static member acos: input: Tensor -> Tensor
static member add: a: Tensor * b: Tensor -> Tensor
static member arange: endVal: float * ?startVal: float * ?step: float * ?device: Device * ?dtype: Dtype * ?backend: Backend -> Tensor + 1 overload
static member arangeLike: input: Tensor * endVal: float * ?startVal: float * ?step: float * ?device: Device * ?dtype: Dtype * ?backend: Backend -> Tensor + 1 overload
static member argmax: input: Tensor -> int[] + 1 overload
static member argmin: input: Tensor -> int[] + 1 overload
static member asin: input: Tensor -> Tensor
static member atan: input: Tensor -> Tensor
static member backends: unit -> Backend list
...<br/><em><summary>
Tensor operations
</summary></em></div>
<divclass="fsdocs-tip" id="fs3">static member DiffSharp.dsharp.config: unit -> DiffSharp.Device * DiffSharp.Dtype * DiffSharp.Backend * DiffSharp.Printer<br/>static member DiffSharp.dsharp.config: configuration: (DiffSharp.Device * DiffSharp.Dtype * DiffSharp.Backend * DiffSharp.Printer) -> unit<br/>static member DiffSharp.dsharp.config: ?device: DiffSharp.Device * ?dtype: DiffSharp.Dtype * ?backend: DiffSharp.Backend * ?printer: DiffSharp.Printer -> unit</div>
<divclass="fsdocs-tip" id="fs4">Multiple items<br/>module Backend
from DiffSharp<br/><em><summary>
Contains functions and settings related to backend specifications.
</summary></em><br/><br/>--------------------<br/>type Backend =
| Reference
| Torch
| Other of name: string * code: int
override ToString: unit -> string
member Name: string<br/><em><summary>
Represents a backend for DiffSharp tensors
</summary></em></div>
<divclass="fsdocs-tip" id="fs5">union case DiffSharp.Backend.Reference: DiffSharp.Backend<br/><em><summary>
The reference backend
</summary></em></div>
<divclass="fsdocs-tip" id="fs6">static member DiffSharp.dsharp.seed: ?seed: int -> unit</div>
<divclass="fsdocs-tip" id="fs7">namespace System</div>
<divclass="fsdocs-tip" id="fs8">namespace System.Runtime</div>
<divclass="fsdocs-tip" id="fs9">namespace System.Runtime.InteropServices</div>
<divclass="fsdocs-tip" id="fs10">static member dsharp.config: unit -> Device * Dtype * Backend * Printer<br/>static member dsharp.config: configuration: (Device * Dtype * Backend * Printer) -> unit<br/>static member dsharp.config: ?device: Device * ?dtype: Dtype * ?backend: Backend * ?printer: Printer -> unit</div>
<divclass="fsdocs-tip" id="fs11">Multiple items<br/>module Dtype
from DiffSharp<br/><em><summary>
Contains functions and settings related to tensor element types
</summary></em><br/><br/>--------------------<br/>[<Struct>]
type Dtype =
| BFloat16
| Float16
| Float32
| Float64
| Int8
| Byte
| Int16
| Int32
| Int64
| Bool
override ToString: unit -> string
member SummationType: Dtype<br/><em><summary>
Represents a storage type for elements of a tensor
</summary></em></div>
<divclass="fsdocs-tip" id="fs12">union case Dtype.Float32: Dtype<br/><em><summary>
Store elements as 32-bit floating point numbers
</summary></em></div>
<divclass="fsdocs-tip" id="fs13">Multiple items<br/>union case Device.Device: DeviceType * int -> Device<br/><br/>--------------------<br/>module Device
from DiffSharp<br/><em><summary>
Contains functions and settings related to device specifications.
</summary></em><br/><br/>--------------------<br/>[<Struct>]
type Device =
| Device of DeviceType * int
override ToString: unit -> string
member DeviceIndex: int
member DeviceType: DeviceType
static member CPU: Device
static member GPU: Device<br/><em><summary>
Represents a device specification.
</summary></em></div>
<divclass="fsdocs-tip" id="fs14">property Device.GPU: Device with get</div>
<divclass="fsdocs-tip" id="fs15">union case Backend.Torch: Backend<br/><em><summary>
The LibTorch backend
</summary></em></div>
<divclass="fsdocs-tip" id="fs16">union case Backend.Reference: Backend<br/><em><summary>
The reference backend
</summary></em></div>
<divclass="fsdocs-tip" id="fs17">val t: Tensor</div>
<divclass="fsdocs-tip" id="fs18">static member dsharp.tensor: value: obj * ?device: Device * ?dtype: Dtype * ?backend: Backend -> Tensor</div>
<divclass="fsdocs-tip" id="fs19">val device: Device</div>
<divclass="fsdocs-tip" id="fs20">val backend: Backend</div>
<divclass="fsdocs-tip" id="fs21">val t2: Tensor</div>
</div>
</div>
<divclass="row">
<divclass="span3"></div>
<divclass="span9">
<hr>
<pstyle="height:50px; display: table-cell; vertical-align: bottom;">© Copyright 2021, DiffSharp Contributors.</p>
<br>
</div>
</div>
</div>
<!-- BEGIN SEARCH BOX: this adds support for the search box -->
<linkrel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/JavaScript-autoComplete/1.0.4/auto-complete.css" />
<scripttype="text/javascript">varfsdocs_search_baseurl='https://diffsharp.github.io/'</script>
<scripttype="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.3.8/lunr.min.js"></script>
<scripttype="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/JavaScript-autoComplete/1.0.4/auto-complete.min.js"></script>
<scripttype="text/javascript" src="https://diffsharp.github.io/content/fsdocs-search.js"></script>
<!-- END SEARCH BOX: this adds support for the search box -->
</body>
</html>