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§
Sourcefn forward(&self, graph: &GraphData) -> Result<GraphData>
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.
Sourcefn parameters(&self) -> Vec<Tensor>
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".