MCPcopy Create free account
hub / github.com/OpenMeshLab/MeshXL / undiscretize

Function undiscretize

models/mesh_xl/tokenizer.py:23–33  ·  view source on GitHub ↗
(
    t: Tensor,
    continuous_range = Tuple[float, float],
    num_discrete: int = 128
)

Source from the content-addressed store, hash-verified

21
22
23def undiscretize(
24 t: Tensor,
25 continuous_range = Tuple[float, float],
26 num_discrete: int = 128
27) -> Tensor:
28 lo, hi = continuous_range
29 assert hi > lo
30 t = t.float()
31 t += 0.5
32 t /= num_discrete # cube normalize
33 return t * (hi - lo) + lo
34
35
36

Callers 1

detokenizeMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected