Skip to main content

YoloCiouLossBackward

Struct YoloCiouLossBackward 

Source
pub struct YoloCiouLossBackward<D: Float> {
    pub name: &'static str,
    pub id: String,
    pub block_n: i32,
    pub kernel_source: String,
    pub entry_point_source: String,
    pub source: String,
    /* private fields */
}
Expand description

Fused CIoU loss backward: computes ∂L/∂pred given the upstream gradient and the saved activations from the forward pass.

Only produces gradients w.r.t. pred; target boxes are treated as constants.

Gradient decomposes into three independent parts:

(a) IoU term: ∂(−IoU)/∂pred (b) Center-distance term: ∂(d²/(c²+ε))/∂pred (c) α·v term: ∂(α·v)/∂(pw,ph) — zero for (px,py)

The min/max branching for intersection and enclosing-box corners is re-derived from (pred, target) rather than saved, since pred+target fully determine which branch was active.

Grid: cdiv(N, BLOCK_N) — one CTA per anchor tile.

Fields§

§name: &'static str

The kernel function’s name (e.g. "flash_attention2_forward").

§id: String

Unique kernel identifier: fn_name + dtype(s) + const values joined by “__”.

§block_n: i32

Compile-time kernel constant, from the annotated fn’s const generics.

§kernel_source: String

The original kernel function source.

§entry_point_source: String

The Rust source of the generated C-ABI entry-point wrapper function.

§source: String

Combined source (kernel_source + "\n\n" + entry_point_source); used by the Kernel trait.

Implementations§

Source§

impl<D: Float> YoloCiouLossBackward<D>

Source

pub fn new(block_n: i32) -> Self

Constructs a new kernel instance for these compile-time parameters.

Trait Implementations§

Source§

impl<D: Float> Kernel for YoloCiouLossBackward<D>

Source§

type Args<'__a> = (*mut D, *mut D, *mut D, *mut D, *mut D, *mut D, *mut D, i32)

This kernel’s launch-argument tuple type.
Source§

fn id(&self) -> String

A content hash of this kernel’s source, used as a cache key.
Source§

fn name(&self) -> &str

This kernel’s name.
Source§

fn source(&self) -> &str

This kernel’s full source (DSL + kernel body + entry point wrapper).
Source§

fn kernel_source(&self) -> &str

This kernel’s body source, without the entry-point wrapper.
Source§

fn entry_point_source(&self) -> &str

Returns the Rust source of the generated C-ABI entry-point wrapper function.
§

fn entry_point_name(&self) -> String

Returns the PTX symbol name for this kernel: "{name}_entry_point".

Auto Trait Implementations§

§

impl<D> Freeze for YoloCiouLossBackward<D>

§

impl<D> RefUnwindSafe for YoloCiouLossBackward<D>
where D: RefUnwindSafe,

§

impl<D> Send for YoloCiouLossBackward<D>
where D: Send,

§

impl<D> Sync for YoloCiouLossBackward<D>
where D: Sync,

§

impl<D> Unpin for YoloCiouLossBackward<D>
where D: Unpin,

§

impl<D> UnsafeUnpin for YoloCiouLossBackward<D>

§

impl<D> UnwindSafe for YoloCiouLossBackward<D>
where D: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more