MCPcopy Create free account
hub / github.com/StarRealMan/EINRUL / hashfunction

Function hashfunction

model/encoder.py:23–29  ·  view source on GitHub ↗

coords: 3D coordinates. B x 3 log2T: logarithm of T w.r.t 2

(coords, log2_hashmap_size)

Source from the content-addressed store, hash-verified

21 return torch.cat(out, -1)
22
23def hashfunction(coords, log2_hashmap_size):
24 '''
25 coords: 3D coordinates. B x 3
26 log2T: logarithm of T w.r.t 2
27 '''
28 x, y, z = coords[..., 0], coords[..., 1], coords[..., 2]
29 return ((1<<log2_hashmap_size)-1) & (x*73856093 ^ y*19349663 ^ z*83492791)
30
31BOX_OFFSETS = torch.tensor([[i,j,k] for i in [0, 1] for j in [0, 1] for k in [0, 1]],
32 device='cuda')

Callers 1

get_voxel_verticesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected