spine.utils.conditional

Lazy access to optional third-party dependencies.

The symbols exported here preserve the previous from spine.utils.conditional import torch style while avoiding eager imports and unrelated warnings. Availability flags are cheap import-spec checks. The actual package import is deferred until an attribute on the proxy is used.

Functions

is_sparse_tensor_like(obj)

Check whether an object exposes the sparse tensor API SPINE uses.

Classes

SparseTensorLike(*args, **kwargs)

Structural type for MinkowskiEngine sparse tensors.

class spine.utils.conditional.SparseTensorLike(*args, **kwargs)[source]

Structural type for MinkowskiEngine sparse tensors.

MinkowskiEngine is an optional runtime dependency exposed through a lazy proxy, so ME.SparseTensor cannot be used directly in type expressions. This protocol captures the sparse tensor surface used by SPINE without making static analysis depend on MinkowskiEngine stubs.

Methods

coordinates_at

features_at

dtype: Any
device: Any
F: Any
C: Any
coordinate_map_key: Any
coordinate_manager: Any
features_at(batch_id: int) Any[source]
coordinates_at(batch_id: int) Any[source]