Coordinate management¶
Coordinate managers make sparse support identity explicit. A
CoordinateMapKey belongs to exactly one CoordinateManager; relations
are cached by source key, target key, kernel geometry, semantic operation, and
execution policy. This prevents tensors with equal stride but different rows
from sharing a kernel map.
Feature-only operations preserve the input key. Support-changing operations insert a new map into the same manager so later inverse convolution and branch alignment can refer to the precise execution graph.
- class torch_lattice.core.coords.CoordinateMapKey(manager_id, id, stride)[source]¶
Bases:
objectIdentity of one coordinate support owned by a coordinate manager.
- class torch_lattice.core.coords.RelationKey(source, target, operation, kernel_size, stride, padding, dilation, execution)[source]¶
Bases:
objectIdentity of a cached sparse relation and its execution representation.
- Parameters:
- source: CoordinateMapKey¶
- target: CoordinateMapKey¶
- class torch_lattice.core.coords.CoordinateMap(coords, spatial_range, batch_counts)[source]¶
Bases:
object- Parameters:
- class torch_lattice.core.coords.CoordinateManager[source]¶
Bases:
objectOwn coordinate supports and relations for one sparse execution graph.
- get(key)[source]¶
- Return type:
- Parameters:
key (CoordinateMapKey)
- relation(key)[source]¶
- Return type:
- Parameters:
key (RelationKey)
- set_relation(key, relation)[source]¶
- Return type:
- Parameters:
key (RelationKey)
relation (Any)
- set_forward_relation(key, relation)[source]¶
- Return type:
- Parameters:
key (RelationKey)
relation (Any)
- set_inverse_relation(key, relation)[source]¶
- Return type:
- Parameters:
key (RelationKey)
relation (Any)
- generated_target(source, *, operation, kernel_size, stride, padding, dilation)[source]¶
Return cached support generated by a coordinate-only operation.
- set_generated_target(source, target, *, operation, kernel_size, stride, padding, dilation)[source]¶
Cache one generated coordinate support by its exact geometry.