MCPcopy Create free account
hub / github.com/Ropedia/SpatialBench / inv

Function inv

benchmark/models/mapanything/utils/geometry.py:1040–1048  ·  view source on GitHub ↗

Invert a torch or numpy matrix

(mat)

Source from the content-addressed store, hash-verified

1038
1039
1040def inv(mat):
1041 """
1042 Invert a torch or numpy matrix
1043 """
1044 if isinstance(mat, torch.Tensor):
1045 return torch.linalg.inv(mat)
1046 if isinstance(mat, np.ndarray):
1047 return np.linalg.inv(mat)
1048 raise ValueError(f"bad matrix type = {type(mat)}")
1049
1050
1051def closed_form_pose_inverse(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected