Skip to content

Commit

Permalink
Use Set in containers
Browse files Browse the repository at this point in the history
  • Loading branch information
kenza-bouzid committed Jun 21, 2022
1 parent 584f196 commit 791edd6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import torch
import param
from typing import Any, Callable, Collection, Dict, List, Optional, Sequence, Tuple, Union
from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Tuple, Union

from torch import nn
from pathlib import Path
Expand Down Expand Up @@ -181,13 +181,13 @@ def get_pooling_layer(self) -> Tuple[nn.Module, int]:
num_features = num_encoding * self.pool_out_dim
return pooling_layer, num_features

def get_test_plot_options(self) -> Collection[PlotOption]:
def get_test_plot_options(self) -> Set[PlotOption]:
if self.num_top_slides > 0:
return {PlotOption.HISTOGRAM, PlotOption.TOP_BOTTOM_TILES}
else:
return {PlotOption.HISTOGRAM}

def get_val_plot_options(self) -> Collection[PlotOption]:
def get_val_plot_options(self) -> Set[PlotOption]:
return {PlotOption.HISTOGRAM}

def get_outputs_handler(self) -> DeepMILOutputsHandler:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# ------------------------------------------------------------------------------------------
from pathlib import Path
from typing import Any, Collection, Optional
from typing import Any, Optional, Set

from health_azure.utils import is_running_in_azure_ml
from health_ml.networks.layers.attention_layers import AttentionLayer
Expand Down Expand Up @@ -97,8 +97,8 @@ def get_data_module(self) -> PandaTilesDataModule:
def get_slides_dataset(self) -> Optional[PandaDataset]:
return PandaDataset(root=self.local_datasets[1]) # type: ignore

def get_test_plot_options(self) -> Collection[PlotOption]:
plot_options = super().get_test_plot_options()
def get_test_plot_options(self) -> Set[PlotOption]:
plot_options: Set = super().get_test_plot_options()
plot_options.add(PlotOption.SLIDE_THUMBNAIL_HEATMAP)
return plot_options

Expand Down

0 comments on commit 791edd6

Please sign in to comment.