Skip to main content

GraphLayer

Trait GraphLayer 

Source
pub trait GraphLayer: Debug {
    // Required methods
    fn forward(&self, graph: &GraphData) -> Result<GraphData>;
    fn parameters(&self) -> Vec<Tensor>;
}
Expand description

Trait for graph neural network layers

§Fallibility

forward returns torsh_core::error::Result so that shape mismatches in caller-supplied graphs surface as errors instead of aborting the process.

Required Methods§

Source

fn forward(&self, graph: &GraphData) -> Result<GraphData>

Forward pass through the layer

§Errors

Returns an error when the graph’s feature dimensions do not match the layer, or when an underlying tensor operation fails.

Source

fn parameters(&self) -> Vec<Tensor>

Get layer parameters

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§