utils
graph_edge_lengths(coords, edge_index)
Compute the lengths of edges in a graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coords
|
Tensor
|
Tensor of shape [N, 3] representing the coordinates of N nodes. |
required |
edge_index
|
Tensor
|
Tensor of shape [2, E] representing the edges in the graph, where each column defines an edge from edge_index[0, i] to edge_index[1, i]. |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
Tensor of shape [E, 1] representing the lengths of the edges. |
Source code in src/torch_structure/geometry/utils.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | |
line_direction(start_coords, end_coords)
Compute the direction vectors of lines defined by start and end coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_coords
|
Tensor
|
Tensor of shape [N, 3] representing the start coordinates of N lines. |
required |
end_coords
|
Tensor
|
Tensor of shape [N, 3] representing the end coordinates of N lines. |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
Tensor of shape [N, 3] representing the direction vectors of the lines. |
Source code in src/torch_structure/geometry/utils.py
32 33 34 35 36 37 38 39 40 41 42 43 | |
line_length(start_coords, end_coords)
Compute the length of lines defined by start and end coordinates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_coords
|
Tensor
|
Tensor of shape [N, 3] representing the start coordinates of N lines. |
required |
end_coords
|
Tensor
|
Tensor of shape [N, 3] representing the end coordinates of N lines. |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
Tensor of shape [N, 1] representing the lengths of the lines. |
Source code in src/torch_structure/geometry/utils.py
3 4 5 6 7 8 9 10 11 12 13 14 | |