1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
use crate::internal::*; #[derive(Debug, Clone, new)] pub struct Dummy; impl Op for Dummy { fn name(&self) -> Cow<str> { "Dummy".into() } op_as_typed_op!(); } impl StatelessOp for Dummy { fn eval(&self, _inputs: TVec<Arc<Tensor>>) -> TractResult<TVec<Arc<Tensor>>> { bail!("eval() called on a Dummy op. This is a bug.") } } impl TypedOp for Dummy { typed_op_as_op!(); fn output_facts(&self, _inputs: &[&TypedTensorInfo]) -> TractResult<TVec<TypedTensorInfo>> { Ok(tvec!()) } } impl InferenceRulesOp for Dummy { fn rules<'r, 'p: 'r, 's: 'r>( &'s self, _s: &mut Solver<'r>, _inputs: &'p [TensorProxy], _outputs: &'p [TensorProxy], ) -> InferenceResult { Ok(()) } inference_op_as_op!(); to_typed!(); }