Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

small sr implementation fix (#3551)

Meggison Oritsemisanb7410c0d7a53
diff --git a/kornia/models/small_sr.py b/kornia/models/small_sr.py
index 1f79a6484..69307b96b 100644
--- a/kornia/models/small_sr.py
+++ b/kornia/models/small_sr.py
@@ -47,7 +47,8 @@ class SmallSRNet(nn.Module):
if pretrained:
self.load_from_file(url)
else:
- self.apply(weight_init)
+ with torch.no_grad():
+ weight_init(self)
def load_from_file(self, path_file: str) -> None:
# use torch.hub to load pretrained model