ad_tensors_rs/policy.rs
1/// Differentiation policy for non-smooth branching operations.
2///
3/// # Examples
4///
5/// ```rust
6/// use ad_tensors_rs::DiffPolicy;
7///
8/// let policy = DiffPolicy::StopGradient;
9/// assert_eq!(policy, DiffPolicy::StopGradient);
10/// ```
11#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
12pub enum DiffPolicy {
13 /// Return an explicit mode-not-supported error.
14 Strict,
15 /// Allow primal evaluation and block derivative flow.
16 #[default]
17 StopGradient,
18}