Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion monai/apps/detection/utils/anchor_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ def grid_anchors(self, grid_sizes: List[List[int]], strides: List[List[Tensor]])
"""
anchors = []
cell_anchors = self.cell_anchors
assert cell_anchors is not None
if cell_anchors is None:
raise AssertionError

if not (len(grid_sizes) == len(strides) == len(cell_anchors)):
raise ValueError(
Expand Down
3 changes: 2 additions & 1 deletion monai/networks/blocks/feature_pyramid_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ def __init__(
nn.init.constant_(m.bias, 0.0) # type: ignore

if extra_blocks is not None:
assert isinstance(extra_blocks, ExtraFPNBlock)
if not isinstance(extra_blocks, ExtraFPNBlock):
raise AssertionError
self.extra_blocks = extra_blocks

def get_result_from_inner_blocks(self, x: Tensor, idx: int) -> Tensor:
Expand Down