diff --git a/core/src/ops/cast.rs b/core/src/ops/cast.rs
index fa28127ae6..cca7a569a6 100644
--- a/core/src/ops/cast.rs
+++ b/core/src/ops/cast.rs
@@ -1,4 +1,7 @@
+use tract_data::itertools::Itertools;
+
use crate::internal::*;
+use crate::plan::eval;
pub fn cast(to: DatumType) -> Cast {
Cast { to }
@@ -24,7 +27,8 @@ impl Cast {
Ok(tvec!(tmp.cast_to_dt(self.to)?.into_owned().into_tvalue()))
}
} else {
- Ok(tvec!(input.cast_to_dt(self.to)?.into_owned().into_tvalue()))
+ let out = input.cast_to_dt(self.to)?;
+ Ok(tvec!(out.into_owned().into_tvalue()))
}
}
}
@@ -102,5 +106,162 @@ impl TypedOp for Cast {
Ok(Some(AxisChangeConsequence::new(model, node, None, change)))
}
+ fn codegen(
+ &self,
+ model: &TypedModel,
+ node: &TypedNode,
+ ) -> TractResult