Skip to main content

PsaExtractVOp

Struct PsaExtractVOp 

Source
pub struct PsaExtractVOp<D: Float + Send + Sync + 'static>(/* private fields */);
Expand description

CustomOp for PsaExtractVRuntimeOp.

Graph node: [B, qkv_h, H, W][B, c, H, W] (c = qkv_h / 2)

Implementations§

Source§

impl<D: Float + Send + Sync + 'static> PsaExtractVOp<D>

Source

pub fn new(key_dim: i32, num_heads: usize) -> Self

Creates the graph op for the given key dimension and head count.

Trait Implementations§

Source§

impl<D: Float + Send + Sync + 'static> CustomOp for PsaExtractVOp<D>

Source§

fn name(&self) -> &str

Identifier used in error messages and debug output.
Source§

fn infer_output_shape(&self, input_shapes: &[&Shape]) -> Shape

Compute the output shape given the shapes of all input tensors in order.
Source§

fn as_any(&self) -> &dyn Any

Expose self as &dyn Any so the custom lowering can downcast to the concrete op type. Implement as fn as_any(&self) -> &dyn Any { self }.
Source§

fn lower(&self) -> Option<(String, String, String, Arc<dyn RuntimeOp>)>

Return kernel lowering info so TritonLowering can compile this op without a project-specific middleware. Return None to keep the existing middleware / error behaviour. Read more
Source§

fn lower_backward_source(&self) -> String

Return the backward kernel source for this op (used in training mode). Return an empty string if this op has no backward pass.

Auto Trait Implementations§

§

impl<D> Freeze for PsaExtractVOp<D>

§

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

§

impl<D> Send for PsaExtractVOp<D>

§

impl<D> Sync for PsaExtractVOp<D>

§

impl<D> Unpin for PsaExtractVOp<D>

§

impl<D> UnsafeUnpin for PsaExtractVOp<D>

§

impl<D> UnwindSafe for PsaExtractVOp<D>
where D: RefUnwindSafe,

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