Skip to content

Commit fc0ddab

Browse files
committed
commenting out extra predict interface
1 parent edb6407 commit fc0ddab

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

GANDLF/models/imagenet_unet.py

+13-12
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,24 @@ def forward(self, x):
4040
labels = self.classification_head(features[-1])
4141
return labels
4242

43-
def predict(self, x):
44-
"""Inference method. Switch model to `eval` mode, call `.forward(x)` with `torch.no_grad()`
43+
## commented out because we are not using this interface
44+
# def predict(self, x):
45+
# """Inference method. Switch model to `eval` mode, call `.forward(x)` with `torch.no_grad()`
4546

46-
Args:
47-
x: 4D torch tensor with shape (batch_size, channels, height, width)
47+
# Args:
48+
# x: 4D torch tensor with shape (batch_size, channels, height, width)
4849

49-
Return:
50-
prediction: 4D torch tensor with shape (batch_size, classes, height, width)
50+
# Return:
51+
# prediction: 4D torch tensor with shape (batch_size, classes, height, width)
5152

52-
"""
53-
if self.training:
54-
self.eval()
53+
# """
54+
# if self.training:
55+
# self.eval()
5556

56-
with torch.no_grad():
57-
x = self.forward(x)
57+
# with torch.no_grad():
58+
# x = self.forward(x)
5859

59-
return x
60+
# return x
6061

6162

6263
class Unet(SegmentationModel):

0 commit comments

Comments
 (0)