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

Method __init__

sat/sgm/modules/diffusionmodules/wrappers.py:9–17  ·  view source on GitHub ↗
(self, diffusion_model, compile_model: bool = False, dtype: torch.dtype = torch.float32)

Source from the content-addressed store, hash-verified

7
8class IdentityWrapper(nn.Module):
9 def __init__(self, diffusion_model, compile_model: bool = False, dtype: torch.dtype = torch.float32):
10 super().__init__()
11 compile = (
12 torch.compile
13 if (version.parse(torch.__version__) >= version.parse("2.0.0")) and compile_model
14 else lambda x: x
15 )
16 self.diffusion_model = compile(diffusion_model)
17 self.dtype = dtype
18
19 def forward(self, *args, **kwargs):
20 return self.diffusion_model(*args, **kwargs)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected