mirror of
https://github.com/pykeio/ort
synced 2026-04-25 16:34:55 +02:00
feat: many a feature
I did that thing again! Features in this commit: - `ThreadManager` allows you to define custom thread creation functions for environments & sessions. - Sessions can now opt-out of using the environment's global thread pool. - Implemented the safe `ShapeInferenceContext` wrapper for custom operators. - Prepacked weights allow the CPU execution provider to share one allocation for identical weights between sessions. - Customize workload type to prioritize efficiency; useful for background tasks. - Configurable per-session log identifiers - Dynamic dimension overrides Breaking changes: - `EnvironmentGlobalThreadPoolOptions` is now `GlobalThreadPoolOptions` and uses the builder pattern instead of exposed struct fields.
This commit is contained in:
@@ -30,6 +30,14 @@ impl Operator for CustomOpOne {
|
||||
fn outputs() -> Vec<OperatorOutput> {
|
||||
vec![OperatorOutput::required(TensorElementType::Float32)]
|
||||
}
|
||||
|
||||
fn get_infer_shape_function() -> Option<Box<ort::operator::InferShapeFn>> {
|
||||
Some(Box::new(|ctx| {
|
||||
let inputs = ctx.inputs();
|
||||
ctx.set_output(0, &inputs[0])?;
|
||||
Ok(())
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
impl Kernel for CustomOpOneKernel {
|
||||
|
||||
Reference in New Issue
Block a user