(self, unet, enable_cuda_graph=True)
| 10 | class 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)): |
nothing calls this directly
no outgoing calls
no test coverage detected