MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / reinit

Method reinit

sat/dit_video_concat.py:225–238  ·  view source on GitHub ↗
(self, parent_model=None)

Source from the content-addressed store, hash-verified

223 return self.pos_embedding[:, : self.text_length + kwargs["seq_length"]]
224
225 def reinit(self, parent_model=None):
226 del self.transformer.position_embeddings
227 pos_embed = get_3d_sincos_pos_embed(
228 self.pos_embedding.shape[-1],
229 self.height,
230 self.width,
231 self.compressed_num_frames,
232 height_interpolation=self.height_interpolation,
233 width_interpolation=self.width_interpolation,
234 time_interpolation=self.time_interpolation,
235 )
236 pos_embed = torch.from_numpy(pos_embed).float()
237 pos_embed = rearrange(pos_embed, "t n d -> (t n) d")
238 self.pos_embedding.data[:, -self.num_patches :].copy_(pos_embed)
239
240
241def broadcat(tensors, dim=-1):

Callers

nothing calls this directly

Calls 1

get_3d_sincos_pos_embedFunction · 0.85

Tested by

no test coverage detected