Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/models/tresnet/tresnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, inplanes, planes, stride=1, downsample=None, use_se=True, ant
self.relu = nn.ReLU(inplace=True)
self.downsample = downsample
self.stride = stride
reduce_layer_planes = max(planes * self.expansion // 4, 64)
reduce_layer_planes = max(planes * self.expansion / 4, 64)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Use integer division to ensure proper dimensionality in layer calculations. [possible issue, importance: 8]

Suggested change
reduce_layer_planes = max(planes * self.expansion / 4, 64)
reduce_layer_planes = max(planes * self.expansion // 4, 64)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed integer division (//) to floating-point division (/) which may result in non-integer values for neural network dimensions

self.se = SEModule(planes * self.expansion, reduce_layer_planes) if use_se else None

def forward(self, x):
Expand Down