MCPcopy Create free account
hub / github.com/dcharatan/flowmap / homogenize_vectors

Function homogenize_vectors

flowmap/model/projection.py:18–22  ·  view source on GitHub ↗

Convert batched vectors (xyz) to (xyz0).

(
    vectors: Float[Tensor, "*batch dim"],
)

Source from the content-addressed store, hash-verified

16
17
18def homogenize_vectors(
19 vectors: Float[Tensor, "*batch dim"],
20) -> Float[Tensor, "*batch dim+1"]:
21 """Convert batched vectors (xyz) to (xyz0)."""
22 return torch.cat([vectors, torch.zeros_like(vectors[..., :1])], dim=-1)
23
24
25def transform_rigid(

Callers

nothing calls this directly

Calls 1

catMethod · 0.80

Tested by

no test coverage detected