pub trait OptimizationBuilder<O>: Send {
// Required methods
fn register(&mut self, operation: &OperationIr);
fn build(&self) -> O;
fn reset(&mut self);
fn status(&self) -> OptimizationStatus;
fn properties(&self) -> OptimizationProperties;
fn len(&self) -> usize;
fn clone_dyn(&self) -> Box<dyn OptimizationBuilder<O>>;
// Provided method
fn is_empty(&self) -> bool { ... }
}
Expand description
The fusion operation abstraction allows implementations to fuse many tensor operations into one, improving the performance of the backend.
§Notes
The implementations are free to execute the registered operations the way they want to improve the speed and efficiency of the computational graph. It doesn’t mean that all registered operations should be fused, but that another way of executing them is more efficient.
Also, it is important to return (OptimizationStatus::Closed) when no more registered operation can improve the performance.
Required Methods§
Sourcefn register(&mut self, operation: &OperationIr)
fn register(&mut self, operation: &OperationIr)
Register a new tensor operation.
Sourcefn status(&self) -> OptimizationStatus
fn status(&self) -> OptimizationStatus
Return the builder status.
Sourcefn properties(&self) -> OptimizationProperties
fn properties(&self) -> OptimizationProperties
Return the builder properties.
Sourcefn clone_dyn(&self) -> Box<dyn OptimizationBuilder<O>>
fn clone_dyn(&self) -> Box<dyn OptimizationBuilder<O>>
Clone the optimization builder.