pub struct CustomOperator {Show 15 fields
pub name: String,
pub namespace: String,
pub qualified_name: String,
pub forward_fn: CustomOpFn,
pub shape_fn: Option<ShapeInferenceFn>,
pub gradient_fn: Option<GradientFn>,
pub input_specs: Vec<ArgumentSpec>,
pub output_specs: Vec<ArgumentSpec>,
pub is_differentiable: bool,
pub metadata: HashMap<String, String>,
pub performance_hints: PerformanceHints,
pub type_validator: Option<TypeValidatorFn>,
pub memory_optimizer: Option<MemoryOptimizerFn>,
pub backend_impls: HashMap<String, CustomOpFn>,
pub fusion_info: FusionInfo,
}Expand description
Custom operator definition
Fields§
§name: StringOperator name
namespace: StringNamespace (e.g., “torsh”, “user”)
qualified_name: StringFull qualified name (namespace::name)
forward_fn: CustomOpFnForward computation function
shape_fn: Option<ShapeInferenceFn>Shape inference function
gradient_fn: Option<GradientFn>Gradient computation function (for autograd)
input_specs: Vec<ArgumentSpec>Input argument specifications
output_specs: Vec<ArgumentSpec>Output specifications
is_differentiable: boolWhether this operator is differentiable
metadata: HashMap<String, String>Additional metadata
performance_hints: PerformanceHintsPerformance characteristics
type_validator: Option<TypeValidatorFn>Type validation function
memory_optimizer: Option<MemoryOptimizerFn>Memory optimization function
backend_impls: HashMap<String, CustomOpFn>Backend-specific implementations
fusion_info: FusionInfoFusion compatibility information
Auto Trait Implementations§
impl !RefUnwindSafe for CustomOperator
impl !UnwindSafe for CustomOperator
impl Freeze for CustomOperator
impl Send for CustomOperator
impl Sync for CustomOperator
impl Unpin for CustomOperator
impl UnsafeUnpin for CustomOperator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more