MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / __init__

Method __init__

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

toMethod · 0.45

Tested by

no test coverage detected