MCPcopy
hub / github.com/idiap/fast-transformers / generate_hash

Function generate_hash

tests/clustering/hamming/time_python_api_gpu.py:20–25  ·  view source on GitHub ↗
(n_points, d, b, h)

Source from the content-addressed store, hash-verified

18
19
20def generate_hash(n_points, d, b, h):
21 torch.manual_seed(0)
22 x = torch.rand(n_points, d).cuda()
23 a = torch.randn(b, d + 1).cuda()
24 compute_hashes(x, a, h)
25 return h
26
27
28def time_clustering(L, N, H, E,

Callers 1

time_clusteringFunction · 0.70

Calls 1

compute_hashesFunction · 0.90

Tested by

no test coverage detected