pub struct LogicalOutput {Show 13 fields
pub name: Option<String>,
pub type_: Option<LogicalType>,
pub shape: Vec<usize>,
pub dshape: Vec<(DimName, usize)>,
pub decoder: Option<DecoderKind>,
pub encoding: Option<BoxEncoding>,
pub score_format: Option<ScoreFormat>,
pub normalized: Option<bool>,
pub anchors: Option<Vec<[f32; 2]>>,
pub stride: Option<Stride>,
pub dtype: Option<DType>,
pub quantization: Option<Quantization>,
pub outputs: Vec<PhysicalOutput>,
}Expand description
Logical output: the semantic contract the model exposes.
When outputs is empty, the logical output IS the physical tensor
(dtype and quantization carry the tensor-level fields directly).
When outputs contains one or more PhysicalOutput entries, those
children are the real physical tensors and the logical shape is
the reconstructed shape produced by the fallback merge path.
Fields§
§name: Option<String>Logical output name (optional at the logical level).
type_: Option<LogicalType>Semantic type. None marks the output as “additional” — carried in
the schema for completeness (e.g. diagnostic or auxiliary tensors)
but not participating in decoder dispatch. See
SchemaV2::to_legacy_config_outputs for how typeless outputs are
filtered out of the legacy config, and the module docs for when to
use this vs. a recognised LogicalType variant.
shape: Vec<usize>Reconstructed logical shape (what the fallback dequant+merge path produces).
dshape: Vec<(DimName, usize)>Named dimensions ordered to match shape.
decoder: Option<DecoderKind>Decoder to use for post-processing. Omitted for outputs consumed
directly (e.g. protos) where no decode step is required.
encoding: Option<BoxEncoding>Box encoding. Required on boxes logical outputs in v2.
score_format: Option<ScoreFormat>Score format. Scores only.
normalized: Option<bool>Coordinate format. true means [0, 1] normalized; false means
pixel coordinates relative to the letterboxed model input. None
means unspecified (decoder must infer). boxes and detections
only.
anchors: Option<Vec<[f32; 2]>>Anchor boxes for anchor-encoded logical outputs. Required when
encoding: anchor.
stride: Option<Stride>Spatial stride. For non-split logical outputs this is a spatial
hint (e.g. protos at stride 4). For per-scale splits each child
carries its own stride instead.
dtype: Option<DType>Tensor dtype. Present when outputs is empty (this logical IS the
physical tensor).
quantization: Option<Quantization>Quantization parameters. Present when outputs is empty. None
means the tensor is not quantized (float model).
outputs: Vec<PhysicalOutput>Physical children that realize this logical output. Empty when the logical IS the physical tensor. At most one level of nesting is permitted.
Implementations§
Trait Implementations§
Source§impl Clone for LogicalOutput
impl Clone for LogicalOutput
Source§fn clone(&self) -> LogicalOutput
fn clone(&self) -> LogicalOutput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LogicalOutput
impl Debug for LogicalOutput
Source§impl<'de> Deserialize<'de> for LogicalOutput
impl<'de> Deserialize<'de> for LogicalOutput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for LogicalOutput
impl PartialEq for LogicalOutput
Source§impl Serialize for LogicalOutput
impl Serialize for LogicalOutput
impl StructuralPartialEq for LogicalOutput
Auto Trait Implementations§
impl Freeze for LogicalOutput
impl RefUnwindSafe for LogicalOutput
impl Send for LogicalOutput
impl Sync for LogicalOutput
impl Unpin for LogicalOutput
impl UnsafeUnpin for LogicalOutput
impl UnwindSafe for LogicalOutput
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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