pub trait GraphTensorExt<T, E> {
// Required methods
fn to_tensor_representation(
&self,
) -> Result<(DenseTensor, GraphAdjacencyMatrix), TensorError>
where T: AsRef<[f64]> + Clone,
E: Clone;
fn adjacency_matrix(&self) -> Result<GraphAdjacencyMatrix, TensorError>;
fn node_features(
&self,
num_features: usize,
) -> Result<DenseTensor, TensorError>
where T: AsRef<[f64]> + Clone;
fn feature_extractor(&self) -> GraphFeatureExtractor<'_, T, E>;
}Expand description
Extension trait for Graph to add tensor conversion methods
Required Methods§
Sourcefn to_tensor_representation(
&self,
) -> Result<(DenseTensor, GraphAdjacencyMatrix), TensorError>
fn to_tensor_representation( &self, ) -> Result<(DenseTensor, GraphAdjacencyMatrix), TensorError>
Convert graph to tensor representation
Sourcefn adjacency_matrix(&self) -> Result<GraphAdjacencyMatrix, TensorError>
fn adjacency_matrix(&self) -> Result<GraphAdjacencyMatrix, TensorError>
Get adjacency matrix as sparse tensor
Sourcefn node_features(&self, num_features: usize) -> Result<DenseTensor, TensorError>
fn node_features(&self, num_features: usize) -> Result<DenseTensor, TensorError>
Extract node features as tensor
Sourcefn feature_extractor(&self) -> GraphFeatureExtractor<'_, T, E>
fn feature_extractor(&self) -> GraphFeatureExtractor<'_, T, E>
Create feature extractor