MCPcopy Create free account
hub / github.com/openai/shap-e / encode_to_vector

Method encode_to_vector

shap_e/models/transmitter/pc_encoder.py:172–182  ·  view source on GitHub ↗
(self, batch: AttrDict, options: Optional[AttrDict] = None)

Source from the content-addressed store, hash-verified

170 """
171
172 def encode_to_vector(self, batch: AttrDict, options: Optional[AttrDict] = None) -> torch.Tensor:
173 h, it = self.get_h_and_iterator(batch, options=options)
174 n_unrolls = self.get_n_unrolls()
175
176 for _ in range(n_unrolls):
177 data = next(it)
178 h = self.encoder(h, data)
179 h = self.processor(h)
180
181 h = self.output_proj(self.ln_post(h[:, -self.latent_ctx :]))
182 return h.flatten(1)
183
184 def get_n_unrolls(self):
185 if self.training:

Callers

nothing calls this directly

Calls 2

get_h_and_iteratorMethod · 0.95
get_n_unrollsMethod · 0.95

Tested by

no test coverage detected