#[non_exhaustive]pub struct CustomNode {
pub name: String,
pub op_type: String,
pub domain: String,
pub inputs: Vec<Argument>,
pub outputs: Vec<Argument>,
pub attrs: PublicAttributesOwned,
pub opset: usize,
}Expand description
Public view of a custom (non-built-in) ONNX node.
Inputs are full Argument values with their value stores attached, so
constant input data is readable via Argument::value().
During infer_output_types / CustomOpInference::infer, the outputs
carry placeholder types: only their names and count are meaningful. Output
types are valid once inference has completed (i.e. in every codegen-side
hook method).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringNode name (sanitized, unique within the graph)
op_type: StringRaw ONNX op_type, e.g. “FftReal”
domain: StringRaw ONNX domain, e.g. “custom_domain” (“” = default domain)
inputs: Vec<Argument>The inputs of the node.
outputs: Vec<Argument>The outputs of the node.
attrs: PublicAttributesOwnedONNX attributes, exposed read-only.
opset: usizeOpset version of domain from the model’s opset_import.
Implementations§
Source§impl CustomNode
impl CustomNode
Sourcepub fn new(
name: impl Into<String>,
op_type: impl Into<String>,
domain: impl Into<String>,
inputs: Vec<Argument>,
outputs: Vec<Argument>,
attrs: PublicAttributesOwned,
opset: usize,
) -> Self
pub fn new( name: impl Into<String>, op_type: impl Into<String>, domain: impl Into<String>, inputs: Vec<Argument>, outputs: Vec<Argument>, attrs: PublicAttributesOwned, opset: usize, ) -> Self
Construct a custom node view, e.g. for hook unit tests.
Inside the pipeline, views are built from parsed nodes; hand-built nodes carry no attribute values or constant-input data unless the arguments were constructed with value stores.