Utils module¶
Utils module.
- MARBLE.utils.parallel_proc(fun, iterable, inputs, processes=-1, desc='')[source]¶
Distribute an iterable function between processes
- MARBLE.utils.to_SparseTensor(edge_index, size=None, value=None)[source]¶
Adjacency matrix as torch_sparse tensor
- Parameters:
edge_index (2xE matrix) – edge indices
size – pair (rows,cols) giving the size of the matrix. The default is the largest node of the edge_index.
value – list of weights. The default is unit values.
- Returns:
adjacency matrix in SparseTensor format
- class MARBLE.utils.EdgeIndex(edge_index: Tensor, e_id: Tensor | None, size: Tuple[int, int])[source]¶
Edge Index.
Create new instance of EdgeIndex(edge_index, e_id, size)
- edge_index: Tensor¶
Alias for field number 0
- e_id: Tensor | None¶
Alias for field number 1
- size: Tuple[int, int]¶
Alias for field number 2
- MARBLE.utils.expand_edge_index(edge_index, dim=1)[source]¶
When using rotations, we replace nodes by vector spaces so need to expand adjacency matrix from nxn -> n*dimxn*dim matrices