pub trait GraphClassifier {
// Required methods
fn forward(&self, graph: &GraphData) -> Result<Tensor, TorshError>;
fn parameters(&self) -> Vec<Tensor>;
fn num_classes(&self) -> usize;
}Expand description
Graph classification model trait
Required Methods§
Sourcefn forward(&self, graph: &GraphData) -> Result<Tensor, TorshError>
fn forward(&self, graph: &GraphData) -> Result<Tensor, TorshError>
Forward pass for graph classification Forward pass producing graph-level logits
§Errors
Returns an error when the graph does not match the classifier’s shapes.
Sourcefn parameters(&self) -> Vec<Tensor>
fn parameters(&self) -> Vec<Tensor>
Get model parameters
Sourcefn num_classes(&self) -> usize
fn num_classes(&self) -> usize
Get number of output classes
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".