Skip to content

Commit

Permalink
type ignore idx type
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Li <[email protected]>
  • Loading branch information
wyli committed Jul 13, 2023
1 parent c0b29c5 commit 65e3450
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions monai/transforms/spatial/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -3440,10 +3440,10 @@ def randomize(self, array):

def filter_count(self, image_np: NdarrayOrTensor, locations: np.ndarray) -> tuple[NdarrayOrTensor, np.ndarray]:
if self.sort_fn == GridPatchSort.RANDOM:
idx = self.R.permutation(tuple(range(image_np.shape[0])))
idx = self.R.permutation(image_np.shape[0])
idx = idx[: self.num_patches]
idx_np = convert_data_type(idx, np.ndarray)[0]
image_np = image_np[idx]
image_np = image_np[idx] # type: ignore
locations = locations[idx_np]
return image_np, locations
elif self.sort_fn not in (None, GridPatchSort.MIN, GridPatchSort.MAX):
Expand Down

0 comments on commit 65e3450

Please sign in to comment.