MCPcopy Create free account
hub / github.com/OpenImagingLab/4DSloMo / set_requires_grad

Method set_requires_grad

lpipsPyTorch/modules/networks.py:46–48  ·  view source on GitHub ↗
(self, state: bool)

Source from the content-addressed store, hash-verified

44 'std', torch.Tensor([.458, .448, .450])[None, :, None, None])
45
46 def set_requires_grad(self, state: bool):
47 for param in chain(self.parameters(), self.buffers()):
48 param.requires_grad = state
49
50 def z_score(self, x: torch.Tensor):
51 return (x - self.mean) / self.std

Callers 3

__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected