You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Overlaps with not using extern blocks anymore.
Design proposal as per our discussion:
fn foo<T: Add>(a: T) -> T {
a * a
}
#[autodiff(foo, dfoo, Active, Duplicated)]
fn dfoo<T>(a: T, b: T) -> T;
fn main() {
dbg!(dfoo<f32>(3.14, 1.0));
}
require ; after function declaration trough the autodiff macro.
Automatically replace ; with {unimplemented!();}
Required Checks: dfoo<f32> checks if foo<f32> is a valid instanciation
input and output Activity must be valid for the given T (think of Output for Scalar types, Duplicated for ptr/ref/.. types.
Actions:
Instanciate foo in case that no other code is using foo<f32>.
Mark foo as used s.t. it won't be optimized away. Similar to our previous primary fncs.
Explanation:
Asking for the derivative dfoo<T> must differentiate the source code of foo<T>, so we must instanciate foo<T>.
The text was updated successfully, but these errors were encountered:
…t, r=tmiasko
Encode def span for foreign return-position `impl Trait` in trait
Fixesrust-lang#111031, yet another def-span encoding issue :/
Includes a smaller repro than the issue, but I can confirm it ICEs:
```
query stack during panic:
#0 [def_span] looking up span for `rpitit::Foo::bar::{opaque#0}`
#1 [object_safety_violations] determining object safety of trait `rpitit::Foo`
#2 [check_is_object_safe] checking if trait `rpitit::Foo` is object safe
#3 [typeck] type-checking `main`
#4 [used_trait_imports] finding used_trait_imports `main`
#5 [analysis] running analysis passes on this crate
```
Luckily since this only affects nightly, this desn't need to be backported.
Overlaps with not using extern blocks anymore.
Design proposal as per our discussion:
require
;
after function declaration trough the autodiff macro.Automatically replace
;
with{unimplemented!();}
Required Checks:
dfoo<f32>
checks iffoo<f32>
is a valid instanciationinput and output Activity must be valid for the given T (think of Output for Scalar types, Duplicated for ptr/ref/.. types.
Actions:
Instanciate foo in case that no other code is using
foo<f32>
.Mark foo as used s.t. it won't be optimized away. Similar to our previous primary fncs.
Explanation:
Asking for the derivative
dfoo<T>
must differentiate the source code offoo<T>
, so we must instanciatefoo<T>
.The text was updated successfully, but these errors were encountered: