Skip to content

Commit f4e41c9

Browse files
committed
Deploying to gh-pages from @ 1d1f0bf 🚀
1 parent a6ae206 commit f4e41c9

File tree

7 files changed

+39
-25
lines changed

7 files changed

+39
-25
lines changed

diffusion_rs_core/enum.ModelDType.html

+1-1
Large diffs are not rendered by default.

diffusion_rs_core/enum.ModelSource.html

+5-5
Large diffs are not rendered by default.

diffusion_rs_core/enum.TokenSource.html

+2-2
Large diffs are not rendered by default.
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Type which can be converted to a DType"><title>TryIntoDType in diffusion_rs_core - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-46f98efaafac5295.ttf.woff2,FiraSans-Regular-018c141bf0843ffd.woff2,FiraSans-Medium-8f9a781e4970d388.woff2,SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2,SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-b0742ba02757f159.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="diffusion_rs_core" data-themes="" data-resource-suffix="" data-rustdoc-version="1.83.0 (90b35a623 2024-11-26)" data-channel="1.83.0" data-search-js="search-f0d225181b97f9a4.js" data-settings-js="settings-805db61a62df4bd2.js" ><script src="../static.files/storage-1d39b6787ed640ff.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-f070b9041d14864c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-0111fcff984fae8f.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../diffusion_rs_core/index.html">diffusion_<wbr>rs_<wbr>core</a><span class="version">0.1.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">TryIntoD<wbr>Type</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.try_into_dtype" title="try_into_dtype">try_into_dtype</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-TryIntoDType-for-DType" title="DType">DType</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate diffusion_<wbr>rs_<wbr>core</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">diffusion_rs_core</a></span><h1>Trait <span class="trait">TryIntoDType</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/diffusion_rs_core/util/auto_dtype.rs.html#36-38">source</a> </span></div><pre class="rust item-decl"><code>pub trait TryIntoDType {
22
// Required method
3-
fn <a href="#tymethod.try_into_dtype" class="fn">try_into_dtype</a>(&amp;self, devices: &amp;[&amp;Device], silent: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.94/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;DType&gt;;
3+
fn <a href="#tymethod.try_into_dtype" class="fn">try_into_dtype</a>(&amp;self, devices: &amp;[&amp;<a class="enum" href="../diffusion_rs_common/core/device/enum.Device.html" title="enum diffusion_rs_common::core::device::Device">Device</a>], silent: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.94/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="enum" href="../diffusion_rs_common/core/dtype/enum.DType.html" title="enum diffusion_rs_common::core::dtype::DType">DType</a>&gt;;
44
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Type which can be converted to a DType</p>
5-
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><section id="tymethod.try_into_dtype" class="method"><a class="src rightside" href="../src/diffusion_rs_core/util/auto_dtype.rs.html#37">source</a><h4 class="code-header">fn <a href="#tymethod.try_into_dtype" class="fn">try_into_dtype</a>(&amp;self, devices: &amp;[&amp;Device], silent: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.94/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;DType&gt;</h4></section></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-TryIntoDType-for-DType" class="impl"><a class="src rightside" href="../src/diffusion_rs_core/util/auto_dtype.rs.html#40-50">source</a><a href="#impl-TryIntoDType-for-DType" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.TryIntoDType.html" title="trait diffusion_rs_core::TryIntoDType">TryIntoDType</a> for DType</h3></section></summary><div class="impl-items"><section id="method.try_into_dtype" class="method trait-impl"><a class="src rightside" href="../src/diffusion_rs_core/util/auto_dtype.rs.html#41-49">source</a><a href="#method.try_into_dtype" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.try_into_dtype" class="fn">try_into_dtype</a>(&amp;self, _: &amp;[&amp;Device], silent: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.94/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;DType&gt;</h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-TryIntoDType-for-ModelDType" class="impl"><a class="src rightside" href="../src/diffusion_rs_core/util/auto_dtype.rs.html#146-161">source</a><a href="#impl-TryIntoDType-for-ModelDType" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.TryIntoDType.html" title="trait diffusion_rs_core::TryIntoDType">TryIntoDType</a> for <a class="enum" href="enum.ModelDType.html" title="enum diffusion_rs_core::ModelDType">ModelDType</a></h3></section></div><script src="../trait.impl/diffusion_rs_core/util/auto_dtype/trait.TryIntoDType.js" data-ignore-extern-crates="diffusion_rs_common" async></script></section></div></main></body></html>
5+
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><section id="tymethod.try_into_dtype" class="method"><a class="src rightside" href="../src/diffusion_rs_core/util/auto_dtype.rs.html#37">source</a><h4 class="code-header">fn <a href="#tymethod.try_into_dtype" class="fn">try_into_dtype</a>(&amp;self, devices: &amp;[&amp;<a class="enum" href="../diffusion_rs_common/core/device/enum.Device.html" title="enum diffusion_rs_common::core::device::Device">Device</a>], silent: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.94/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="enum" href="../diffusion_rs_common/core/dtype/enum.DType.html" title="enum diffusion_rs_common::core::dtype::DType">DType</a>&gt;</h4></section></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-TryIntoDType-for-DType" class="impl"><a class="src rightside" href="../src/diffusion_rs_core/util/auto_dtype.rs.html#40-50">source</a><a href="#impl-TryIntoDType-for-DType" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.TryIntoDType.html" title="trait diffusion_rs_core::TryIntoDType">TryIntoDType</a> for <a class="enum" href="../diffusion_rs_common/core/dtype/enum.DType.html" title="enum diffusion_rs_common::core::dtype::DType">DType</a></h3></section></summary><div class="impl-items"><section id="method.try_into_dtype" class="method trait-impl"><a class="src rightside" href="../src/diffusion_rs_core/util/auto_dtype.rs.html#41-49">source</a><a href="#method.try_into_dtype" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.try_into_dtype" class="fn">try_into_dtype</a>(&amp;self, _: &amp;[&amp;<a class="enum" href="../diffusion_rs_common/core/device/enum.Device.html" title="enum diffusion_rs_common::core::device::Device">Device</a>], silent: <a class="primitive" href="https://doc.rust-lang.org/1.83.0/std/primitive.bool.html">bool</a>) -&gt; <a class="type" href="https://docs.rs/anyhow/1.0.94/anyhow/type.Result.html" title="type anyhow::Result">Result</a>&lt;<a class="enum" href="../diffusion_rs_common/core/dtype/enum.DType.html" title="enum diffusion_rs_common::core::dtype::DType">DType</a>&gt;</h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-TryIntoDType-for-ModelDType" class="impl"><a class="src rightside" href="../src/diffusion_rs_core/util/auto_dtype.rs.html#146-161">source</a><a href="#impl-TryIntoDType-for-ModelDType" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.TryIntoDType.html" title="trait diffusion_rs_core::TryIntoDType">TryIntoDType</a> for <a class="enum" href="enum.ModelDType.html" title="enum diffusion_rs_core::ModelDType">ModelDType</a></h3></section></div><script src="../trait.impl/diffusion_rs_core/util/auto_dtype/trait.TryIntoDType.js" data-ignore-extern-crates="diffusion_rs_common" async></script></section></div></main></body></html>

pyo3/diffusion_rs.html

+12-12
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ <h2>API Documentation</h2>
3939
<a class="class" href="#DiffusionGenerationParams">DiffusionGenerationParams</a>
4040
<ul class="memberlist">
4141
<li>
42-
<a class="variable" href="#DiffusionGenerationParams.num_steps">num_steps</a>
42+
<a class="variable" href="#DiffusionGenerationParams.width">width</a>
4343
</li>
4444
<li>
45-
<a class="variable" href="#DiffusionGenerationParams.height">height</a>
45+
<a class="variable" href="#DiffusionGenerationParams.num_steps">num_steps</a>
4646
</li>
4747
<li>
48-
<a class="variable" href="#DiffusionGenerationParams.width">width</a>
48+
<a class="variable" href="#DiffusionGenerationParams.height">height</a>
4949
</li>
5050
<li>
5151
<a class="variable" href="#DiffusionGenerationParams.guidance_scale">guidance_scale</a>
@@ -141,35 +141,35 @@ <h1 class="modulename">
141141

142142

143143

144-
<div id="DiffusionGenerationParams.num_steps" class="classattr">
144+
<div id="DiffusionGenerationParams.width" class="classattr">
145145
<div class="attr variable">
146-
<span class="name">num_steps</span>
146+
<span class="name">width</span>
147147

148148

149149
</div>
150-
<a class="headerlink" href="#DiffusionGenerationParams.num_steps"></a>
150+
<a class="headerlink" href="#DiffusionGenerationParams.width"></a>
151151

152152

153153

154154
</div>
155-
<div id="DiffusionGenerationParams.height" class="classattr">
155+
<div id="DiffusionGenerationParams.num_steps" class="classattr">
156156
<div class="attr variable">
157-
<span class="name">height</span>
157+
<span class="name">num_steps</span>
158158

159159

160160
</div>
161-
<a class="headerlink" href="#DiffusionGenerationParams.height"></a>
161+
<a class="headerlink" href="#DiffusionGenerationParams.num_steps"></a>
162162

163163

164164

165165
</div>
166-
<div id="DiffusionGenerationParams.width" class="classattr">
166+
<div id="DiffusionGenerationParams.height" class="classattr">
167167
<div class="attr variable">
168-
<span class="name">width</span>
168+
<span class="name">height</span>
169169

170170

171171
</div>
172-
<a class="headerlink" href="#DiffusionGenerationParams.width"></a>
172+
<a class="headerlink" href="#DiffusionGenerationParams.height"></a>
173173

174174

175175

pyo3/search.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/diffusion_rs_core/models/t5/mod.rs.html

+16-2
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,14 @@
716716
<a href="#715" id="715">715</a>
717717
<a href="#716" id="716">716</a>
718718
<a href="#717" id="717">717</a>
719-
<a href="#718" id="718">718</a></pre></div><pre class="rust"><code><span class="attr">#![allow(clippy::cast_possible_truncation, clippy::cast_precision_loss)]
719+
<a href="#718" id="718">718</a>
720+
<a href="#719" id="719">719</a>
721+
<a href="#720" id="720">720</a>
722+
<a href="#721" id="721">721</a>
723+
<a href="#722" id="722">722</a>
724+
<a href="#723" id="723">723</a>
725+
<a href="#724" id="724">724</a>
726+
<a href="#725" id="725">725</a></pre></div><pre class="rust"><code><span class="attr">#![allow(clippy::cast_possible_truncation, clippy::cast_precision_loss)]
720727

721728
</span><span class="comment">// T5 Text Model
722729
// https://github.com/huggingface/transformers/blob/main/src/transformers/models/t5/modeling_t5.py
@@ -725,6 +732,7 @@
725732
<span class="kw">use </span>diffusion_rs_common::core::{DType, Device, Module, <span class="prelude-ty">Result</span>, Tensor, D};
726733
<span class="kw">use </span>diffusion_rs_common::nn::{Activation, Embedding};
727734
<span class="kw">use </span>diffusion_rs_common::{embedding, VarBuilder};
735+
<span class="kw">use </span>float8::F8E4M3;
728736
<span class="kw">use </span>serde::Deserialize;
729737
<span class="kw">use </span>std::sync::Arc;
730738

@@ -1197,11 +1205,17 @@
11971205
<span class="kw">fn </span>any(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="prelude-ty">Result</span>&lt;bool&gt; {
11981206
<span class="kw">let </span>sum = <span class="self">self</span>.sum_all()<span class="question-mark">?</span>;
11991207
<span class="kw">match </span><span class="self">self</span>.dtype() {
1208+
DType::I8 =&gt; <span class="prelude-val">Ok</span>(sum.to_scalar::&lt;u8&gt;()<span class="question-mark">? </span>== <span class="number">0</span>),
1209+
DType::U8 =&gt; <span class="prelude-val">Ok</span>(sum.to_scalar::&lt;u8&gt;()<span class="question-mark">? </span>== <span class="number">0</span>),
1210+
DType::U32 =&gt; <span class="prelude-val">Ok</span>(sum.to_scalar::&lt;u32&gt;()<span class="question-mark">? </span>== <span class="number">0</span>),
1211+
DType::I16 =&gt; <span class="prelude-val">Ok</span>(sum.to_scalar::&lt;i16&gt;()<span class="question-mark">? </span>== <span class="number">0</span>),
1212+
DType::I32 =&gt; <span class="prelude-val">Ok</span>(sum.to_scalar::&lt;i32&gt;()<span class="question-mark">? </span>== <span class="number">0</span>),
1213+
DType::I64 =&gt; <span class="prelude-val">Ok</span>(sum.to_scalar::&lt;i64&gt;()<span class="question-mark">? </span>== <span class="number">0</span>),
12001214
DType::F16 =&gt; <span class="prelude-val">Ok</span>(sum.to_scalar::&lt;half::f16&gt;()<span class="question-mark">? </span>== half::f16::from_f32_const(<span class="number">0.</span>)),
12011215
DType::BF16 =&gt; <span class="prelude-val">Ok</span>(sum.to_scalar::&lt;half::bf16&gt;()<span class="question-mark">? </span>== half::bf16::from_f32_const(<span class="number">0.</span>)),
12021216
DType::F32 =&gt; <span class="prelude-val">Ok</span>(sum.to_scalar::&lt;f32&gt;()<span class="question-mark">? </span>== <span class="number">0.</span>),
12031217
DType::F64 =&gt; <span class="prelude-val">Ok</span>(sum.to_scalar::&lt;f64&gt;()<span class="question-mark">? </span>== <span class="number">0.</span>),
1204-
<span class="kw">_ </span>=&gt; <span class="macro">unreachable!</span>(),
1218+
DType::F8E4M3 =&gt; <span class="prelude-val">Ok</span>(sum.to_scalar::&lt;F8E4M3&gt;()<span class="question-mark">? </span>== F8E4M3::ZERO),
12051219
}
12061220
}
12071221
}

0 commit comments

Comments
 (0)