function

assignment.resolve_backend

def resolve_backend(cost: torch.Tensor, backend: Backend | str = Backend.AUTO) -> str

Return the op name that ``solve()`` would dispatch to.

Useful for debugging AUTO routing and for asserting which backend fires in a test or benchmark.

Parameters

NameTypeDescription
costtorch.TensorCost matrix (N, M) or (B, N, M) on the target device.
backend = Backend.AUTOBackend | strBackend hint. Non-``AUTO`` values are echoed back as their string value (e.g. ``"munkres"``).

Returns

op_name — Exact ``torch.ops.assignment.<name>`` key — e.g. ``"jonker_compact"``, ``"munkres"``, ``"lawler"``, ``"greedy"``.

Source: torchmatch/assignment/_solve.py:291