Struct ConnectedStatsPrimitive
pub struct ConnectedStatsPrimitive<B>where
B: Backend,{
pub area: <B as BackendTypes>::IntTensorPrimitive,
pub left: <B as BackendTypes>::IntTensorPrimitive,
pub top: <B as BackendTypes>::IntTensorPrimitive,
pub right: <B as BackendTypes>::IntTensorPrimitive,
pub bottom: <B as BackendTypes>::IntTensorPrimitive,
pub max_label: <B as BackendTypes>::IntTensorPrimitive,
}Expand description
Primitive version of ConnectedStats, to be returned by the backend.
Accelerated Cube operations reserve height * width entries for each statistics
array. CPU fallbacks return one entry per component, including background.
Fusion retains image-sized metadata for these arrays even on CPU fallback,
preserving the existing discrepancy with their compact data. max_label has one entry.
Fields§
§area: <B as BackendTypes>::IntTensorPrimitiveTotal area of each component
left: <B as BackendTypes>::IntTensorPrimitiveLeftmost x coordinate in the component
top: <B as BackendTypes>::IntTensorPrimitiveTopmost y coordinate in the component
right: <B as BackendTypes>::IntTensorPrimitiveRightmost x coordinate in the component
bottom: <B as BackendTypes>::IntTensorPrimitiveBottommost y coordinate in the component
max_label: <B as BackendTypes>::IntTensorPrimitiveScalar tensor of the max label
Trait Implementations§
§impl<B> ExtensionType<B> for ConnectedStatsPrimitive<B>where
B: Backend,
impl<B> ExtensionType<B> for ConnectedStatsPrimitive<B>where
B: Backend,
§type Target = ConnectedStatsPrimitive<Dispatch>
type Target = ConnectedStatsPrimitive<Dispatch>
The target struct layout where all internal concrete backend tensors are transformed
into
DispatchTensors.§fn map_to_dispatch<F>(
self,
map_kind: F,
autodiff: DispatchAutodiffContext,
) -> <ConnectedStatsPrimitive<B> as ExtensionType<B>>::Target
fn map_to_dispatch<F>( self, map_kind: F, autodiff: DispatchAutodiffContext, ) -> <ConnectedStatsPrimitive<B> as ExtensionType<B>>::Target
Transforms the internal fields of the struct by applying a backend-specific wrapping closure. Read more
§fn map_from_dispatch<F>(
target: <ConnectedStatsPrimitive<B> as ExtensionType<B>>::Target,
unwrap_kind: F,
) -> ConnectedStatsPrimitive<B>
fn map_from_dispatch<F>( target: <ConnectedStatsPrimitive<B> as ExtensionType<B>>::Target, unwrap_kind: F, ) -> ConnectedStatsPrimitive<B>
§fn routing_tensor(
target: &<ConnectedStatsPrimitive<B> as ExtensionType<B>>::Target,
) -> Option<&DispatchTensor>
fn routing_tensor( target: &<ConnectedStatsPrimitive<B> as ExtensionType<B>>::Target, ) -> Option<&DispatchTensor>
Return a tensor of the dispatch form to use for routing, or
None if this value
currently holds no tensor (e.g. an enum on a tensor-less variant). Read more§fn routing_float_tensor(
target: &<ConnectedStatsPrimitive<B> as ExtensionType<B>>::Target,
) -> Option<&DispatchTensor>
fn routing_float_tensor( target: &<ConnectedStatsPrimitive<B> as ExtensionType<B>>::Target, ) -> Option<&DispatchTensor>
Auto Trait Implementations§
impl<B> Freeze for ConnectedStatsPrimitive<B>
impl<B> RefUnwindSafe for ConnectedStatsPrimitive<B>
impl<B> Send for ConnectedStatsPrimitive<B>
impl<B> Sync for ConnectedStatsPrimitive<B>
impl<B> Unpin for ConnectedStatsPrimitive<B>
impl<B> UnsafeUnpin for ConnectedStatsPrimitive<B>
impl<B> UnwindSafe for ConnectedStatsPrimitive<B>
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
§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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