mirror of
https://github.com/pykeio/ort
synced 2026-04-25 16:34:55 +02:00
refactor!: flatten operator module
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
use ort::{
|
||||
operator::{
|
||||
Operator, OperatorDomain,
|
||||
io::{OperatorInput, OperatorOutput},
|
||||
kernel::{Kernel, KernelAttributes, KernelContext}
|
||||
},
|
||||
operator::{Kernel, KernelAttributes, KernelContext, Operator, OperatorDomain, OperatorInput, OperatorOutput},
|
||||
session::Session,
|
||||
value::{Tensor, TensorElementType}
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@ use smallvec::SmallVec;
|
||||
|
||||
use crate::{
|
||||
AsPointer, Error, OnceLock, Result,
|
||||
operator::attribute::Attribute,
|
||||
operator::Attribute,
|
||||
ortsys,
|
||||
session::{Session, builder::SessionBuilder},
|
||||
util::{with_cstr, with_cstr_ptr_array},
|
||||
@@ -68,7 +68,7 @@ impl Node {
|
||||
/// - `attributes` is an array of attributes used to configure the operator, e.g. `strides` for `Conv` nodes.
|
||||
///
|
||||
/// ```
|
||||
/// # use ort::{editor::{Node, ONNX_DOMAIN}, operator::attribute::Attribute};
|
||||
/// # use ort::{editor::{Node, ONNX_DOMAIN}, operator::Attribute};
|
||||
/// # fn main() -> ort::Result<()> {
|
||||
/// let node = Node::new(
|
||||
/// "Conv",
|
||||
|
||||
@@ -210,7 +210,7 @@ impl<'a> AsPointer for Logger<'a> {
|
||||
/// Logs a message to a given [`Logger`].
|
||||
///
|
||||
/// ```
|
||||
/// # use ort::operator::kernel::{Kernel, KernelContext};
|
||||
/// # use ort::operator::{Kernel, KernelContext};
|
||||
/// struct MyKernel;
|
||||
///
|
||||
/// impl Kernel for MyKernel {
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
use alloc::{boxed::Box, ffi::CString, vec::Vec};
|
||||
use core::ptr::{self, NonNull};
|
||||
|
||||
pub mod attribute;
|
||||
mod attribute;
|
||||
pub(crate) mod bound;
|
||||
pub mod io;
|
||||
pub mod kernel;
|
||||
mod io;
|
||||
mod kernel;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
use self::{
|
||||
attribute::FromOpAttr,
|
||||
bound::BoundOperator,
|
||||
io::{OperatorInput, OperatorOutput},
|
||||
kernel::{Kernel, KernelAttributes}
|
||||
use self::bound::BoundOperator;
|
||||
pub use self::{
|
||||
attribute::{Attribute, FromKernelAttributes, FromOpAttr, ToAttribute},
|
||||
io::{InputOutputCharacteristic, OperatorInput, OperatorOutput},
|
||||
kernel::{Kernel, KernelAttributes, KernelContext, ScratchBuffer}
|
||||
};
|
||||
use crate::{
|
||||
AsPointer, Error,
|
||||
@@ -45,7 +45,7 @@ pub trait Operator: Send {
|
||||
/// stream.
|
||||
///
|
||||
/// [`Tensor::data_ptr`]: crate::value::Tensor::data_ptr
|
||||
/// [`KernelContext::compute_stream`]: crate::operator::kernel::KernelContext::compute_stream
|
||||
/// [`KernelContext::compute_stream`]: crate::operator::KernelContext::compute_stream
|
||||
fn execution_provider_type(&self) -> Option<&str> {
|
||||
None
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
use crate::{
|
||||
Result,
|
||||
operator::{
|
||||
Operator, OperatorDomain,
|
||||
io::{OperatorInput, OperatorOutput},
|
||||
kernel::{Kernel, KernelAttributes, KernelContext}
|
||||
},
|
||||
operator::{Kernel, KernelAttributes, KernelContext, Operator, OperatorDomain, OperatorInput, OperatorOutput},
|
||||
session::Session,
|
||||
value::{Tensor, TensorElementType}
|
||||
};
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
use ort::{
|
||||
ep,
|
||||
memory::{AllocationDevice, Allocator, AllocatorType, MemoryInfo, MemoryType},
|
||||
operator::{
|
||||
Operator, OperatorDomain,
|
||||
io::{OperatorInput, OperatorOutput},
|
||||
kernel::{Kernel, KernelAttributes, KernelContext}
|
||||
},
|
||||
operator::{Kernel, KernelAttributes, KernelContext, Operator, OperatorDomain, OperatorInput, OperatorOutput},
|
||||
session::{Adapter, RunOptions, Session},
|
||||
value::{Tensor, TensorElementType}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user