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

Method forward

sat/sgm/modules/autoencoding/magvit2_pytorch.py:423–432  ·  view source on GitHub ↗
(self, x, *args, **kwargs)

Source from the content-addressed store, hash-verified

421
422class SpaceAttention(Attention):
423 def forward(self, x, *args, **kwargs):
424 x = rearrange(x, "b c t h w -> b t h w c")
425 x, batch_ps = pack_one(x, "* h w c")
426 x, seq_ps = pack_one(x, "b * c")
427
428 x = super().forward(x, *args, **kwargs)
429
430 x = unpack_one(x, seq_ps, "b * c")
431 x = unpack_one(x, batch_ps, "* h w c")
432 return rearrange(x, "b t h w c -> b c t h w")
433
434
435class TimeAttention(Attention):

Callers

nothing calls this directly

Calls 3

pack_oneFunction · 0.70
unpack_oneFunction · 0.70
forwardMethod · 0.45

Tested by

no test coverage detected