MCPcopy Create free account
hub / github.com/GeWu-Lab/AnyTouch2 / codebook

Method codebook

model/layers/gumbel_vector_quantizer.py:116–122  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

114 return self.codebook_indices
115
116 def codebook(self):
117 indices = self.get_codebook_indices()
118 return (
119 self.vars.squeeze(0)
120 .index_select(0, indices)
121 .view(self.num_vars**self.groups, -1)
122 )
123
124 def sample_from_codebook(self, b, n):
125 indices = self.get_codebook_indices()

Callers

nothing calls this directly

Calls 1

get_codebook_indicesMethod · 0.95

Tested by

no test coverage detected