mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
fix final norm only apply at last indice
This commit is contained in:
parent
e0ae4db8fc
commit
72b2a09106
@ -318,8 +318,11 @@ class RDNet(nn.Module):
|
|||||||
feat_idx += 1
|
feat_idx += 1
|
||||||
x = stage(x)
|
x = stage(x)
|
||||||
if feat_idx in take_indices:
|
if feat_idx in take_indices:
|
||||||
# NOTE not bothering to apply norm_pre when norm=True as almost no models have it enabled
|
if norm and feat_idx == last_idx:
|
||||||
intermediates.append(x)
|
x_inter = self.norm_pre(x) # applying final norm to last intermediate
|
||||||
|
else:
|
||||||
|
x_inter = x
|
||||||
|
intermediates.append(x_inter)
|
||||||
|
|
||||||
if intermediates_only:
|
if intermediates_only:
|
||||||
return intermediates
|
return intermediates
|
||||||
|
Loading…
x
Reference in New Issue
Block a user