Add Optional to remaining types (#37808)
More Optional typing Signed-off-by: cyy <cyyever@outlook.com>
This commit is contained in:
@@ -41,7 +41,7 @@ class BridgeTowerImageProcessingTester:
|
||||
self,
|
||||
parent,
|
||||
do_resize: bool = True,
|
||||
size: dict[str, int] = None,
|
||||
size: Optional[dict[str, int]] = None,
|
||||
size_divisor: int = 32,
|
||||
do_rescale: bool = True,
|
||||
rescale_factor: Union[int, float] = 1 / 255,
|
||||
|
||||
@@ -92,12 +92,12 @@ class PatchTSMixerModelTester:
|
||||
head_dropout: float = 0.2,
|
||||
# forecast related
|
||||
prediction_length: int = 16,
|
||||
out_channels: int = None,
|
||||
out_channels: Optional[int] = None,
|
||||
# Classification/regression related
|
||||
# num_labels: int = 3,
|
||||
num_targets: int = 3,
|
||||
output_range: list = None,
|
||||
head_aggregation: str = None,
|
||||
output_range: Optional[list] = None,
|
||||
head_aggregation: Optional[str] = None,
|
||||
# Trainer related
|
||||
batch_size=13,
|
||||
is_training=True,
|
||||
|
||||
@@ -41,12 +41,12 @@ class TvpImageProcessingTester:
|
||||
do_resize: bool = True,
|
||||
size: dict[str, int] = {"longest_edge": 40},
|
||||
do_center_crop: bool = False,
|
||||
crop_size: dict[str, int] = None,
|
||||
crop_size: Optional[dict[str, int]] = None,
|
||||
do_rescale: bool = False,
|
||||
rescale_factor: Union[int, float] = 1 / 255,
|
||||
do_pad: bool = True,
|
||||
pad_size: dict[str, int] = {"height": 80, "width": 80},
|
||||
fill: int = None,
|
||||
fill: Optional[int] = None,
|
||||
pad_mode: PaddingMode = None,
|
||||
do_normalize: bool = True,
|
||||
image_mean: Optional[Union[float, list[float]]] = [0.48145466, 0.4578275, 0.40821073],
|
||||
|
||||
Reference in New Issue
Block a user