tenferro_ops/input_key.rs
1use chainrules_core::{ADKey, DiffPassId};
2
3#[derive(Clone, Debug, Hash, PartialEq, Eq)]
4pub enum TensorInputKey {
5 User {
6 id: u64,
7 },
8 Tangent {
9 of: Box<TensorInputKey>,
10 pass: DiffPassId,
11 },
12}
13
14impl ADKey for TensorInputKey {
15 fn tangent_of(&self, pass: DiffPassId) -> Self {
16 TensorInputKey::Tangent {
17 of: Box::new(self.clone()),
18 pass,
19 }
20 }
21}