File tree Expand file tree Collapse file tree 5 files changed +225
-127
lines changed Expand file tree Collapse file tree 5 files changed +225
-127
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ pub struct AutoDiffAttrs {
77
77
/// e.g. in the [JAX
78
78
/// Documentation](https://jax.readthedocs.io/en/latest/_tutorials/advanced-autodiff.html#how-it-s-made-two-foundational-autodiff-functions).
79
79
pub mode : DiffMode ,
80
+ pub width : u32 ,
80
81
pub ret_activity : DiffActivity ,
81
82
pub input_activity : Vec < DiffActivity > ,
82
83
}
@@ -222,13 +223,15 @@ impl AutoDiffAttrs {
222
223
pub const fn error ( ) -> Self {
223
224
AutoDiffAttrs {
224
225
mode : DiffMode :: Error ,
226
+ width : 0 ,
225
227
ret_activity : DiffActivity :: None ,
226
228
input_activity : Vec :: new ( ) ,
227
229
}
228
230
}
229
231
pub fn source ( ) -> Self {
230
232
AutoDiffAttrs {
231
233
mode : DiffMode :: Source ,
234
+ width : 0 ,
232
235
ret_activity : DiffActivity :: None ,
233
236
input_activity : Vec :: new ( ) ,
234
237
}
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ builtin_macros_autodiff_ret_activity = invalid return activity {$act} in {$mode}
79
79
builtin_macros_autodiff_ty_activity = { $act } can not be used for this type
80
80
builtin_macros_autodiff_unknown_activity = did not recognize Activity: `{ $act } `
81
81
82
+ builtin_macros_autodiff_width = autodiff width must fit u32, but is { $width }
82
83
builtin_macros_bad_derive_target = `derive` may only be applied to `struct`s, `enum`s and `union`s
83
84
.label = not applicable here
84
85
.label2 = not a `struct`, `enum` or `union`
You can’t perform that action at this time.
0 commit comments