MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / __init__

Method __init__

deepspeed/model_implementations/diffusers/unet.py:12–23  ·  view source on GitHub ↗
(self, unet, enable_cuda_graph=True)

Source from the content-addressed store, hash-verified

10class DSUNet(CUDAGraph, torch.nn.Module):
11
12 def __init__(self, unet, enable_cuda_graph=True):
13 super().__init__(enable_cuda_graph=enable_cuda_graph)
14 self.unet = unet
15 # SD pipeline accesses this attribute
16 self.in_channels = unet.in_channels
17 self.device = self.unet.device
18 self.dtype = self.unet.dtype
19 self.config = self.unet.config
20 self.fwd_count = 0
21 self.unet.requires_grad_(requires_grad=False)
22 self.unet.to(memory_format=torch.channels_last)
23 self.cuda_graph_created = False
24
25 def _graph_replay(self, *inputs, **kwargs):
26 for i in range(len(inputs)):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected