pub struct EdgeFeaturedAttention { /* private fields */ }Expand description
Edge-featured attention (GATv2-style)
Implementations§
Source§impl EdgeFeaturedAttention
impl EdgeFeaturedAttention
pub fn into_reference( val: EdgeFeaturedAttention, env: Env, ) -> Result<Reference<EdgeFeaturedAttention>>
pub fn into_instance( self, env: Env, ) -> Result<ClassInstance<EdgeFeaturedAttention>>
Source§impl EdgeFeaturedAttention
impl EdgeFeaturedAttention
Sourcepub fn new(config: EdgeFeaturedConfig) -> Self
pub fn new(config: EdgeFeaturedConfig) -> Self
Create a new edge-featured attention instance
§Arguments
config- Edge-featured attention configuration
Sourcepub fn simple(node_dim: u32, edge_dim: u32, num_heads: u32) -> Self
pub fn simple(node_dim: u32, edge_dim: u32, num_heads: u32) -> Self
Create with simple parameters
Sourcepub fn compute(
&self,
query: Float32Array,
keys: Vec<Float32Array>,
values: Vec<Float32Array>,
) -> Result<Float32Array>
pub fn compute( &self, query: Float32Array, keys: Vec<Float32Array>, values: Vec<Float32Array>, ) -> Result<Float32Array>
Compute attention without edge features (standard attention)
Sourcepub fn compute_with_edges(
&self,
query: Float32Array,
keys: Vec<Float32Array>,
values: Vec<Float32Array>,
edge_features: Vec<Float32Array>,
) -> Result<Float32Array>
pub fn compute_with_edges( &self, query: Float32Array, keys: Vec<Float32Array>, values: Vec<Float32Array>, edge_features: Vec<Float32Array>, ) -> Result<Float32Array>
Compute attention with edge features
§Arguments
query- Query vectorkeys- Array of key vectorsvalues- Array of value vectorsedge_features- Array of edge feature vectors (same length as keys)
Trait Implementations§
Source§impl FromNapiMutRef for EdgeFeaturedAttention
impl FromNapiMutRef for EdgeFeaturedAttention
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for EdgeFeaturedAttention
impl FromNapiRef for EdgeFeaturedAttention
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl FromNapiValue for &EdgeFeaturedAttention
impl FromNapiValue for &EdgeFeaturedAttention
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut EdgeFeaturedAttention
impl FromNapiValue for &mut EdgeFeaturedAttention
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ToNapiValue for EdgeFeaturedAttention
impl ToNapiValue for EdgeFeaturedAttention
Source§unsafe fn to_napi_value(
env: napi_env,
val: EdgeFeaturedAttention,
) -> Result<napi_value>
unsafe fn to_napi_value( env: napi_env, val: EdgeFeaturedAttention, ) -> Result<napi_value>
Safety Read more
Source§impl TypeName for &EdgeFeaturedAttention
impl TypeName for &EdgeFeaturedAttention
Source§impl TypeName for &mut EdgeFeaturedAttention
impl TypeName for &mut EdgeFeaturedAttention
Source§impl TypeName for EdgeFeaturedAttention
impl TypeName for EdgeFeaturedAttention
Source§impl ValidateNapiValue for &EdgeFeaturedAttention
impl ValidateNapiValue for &EdgeFeaturedAttention
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut EdgeFeaturedAttention
impl ValidateNapiValue for &mut EdgeFeaturedAttention
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for EdgeFeaturedAttention
impl RefUnwindSafe for EdgeFeaturedAttention
impl Send for EdgeFeaturedAttention
impl Sync for EdgeFeaturedAttention
impl Unpin for EdgeFeaturedAttention
impl UnsafeUnpin for EdgeFeaturedAttention
impl UnwindSafe for EdgeFeaturedAttention
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