autograd/ops/basic_source_ops.rs
1use crate::Float;
2
3macro_rules! impl_op {
4 ($name:ident) => {
5 pub struct $name;
6 impl<T: Float> crate::op::Op<T> for $name {
7 fn compute(&self, _: &mut crate::op::ComputeContext<T>) {
8 unreachable!()
9 }
10
11 fn grad(&self, _: &mut crate::op::GradientContext<T>) {
12 unreachable!()
13 }
14 }
15 };
16}
17
18impl_op!(Variable);
19impl_op!(Const);
20impl_op!(Placeholder);