Unverified Commit cd77d17a authored by Philip Meier's avatar Philip Meier Committed by GitHub
Browse files

format signatures with black (#2070)

parent 9a3afff4
...@@ -6,10 +6,15 @@ import math ...@@ -6,10 +6,15 @@ import math
irange = range irange = range
def make_grid(tensor: Union[torch.Tensor, Sequence[torch.Tensor]], nrow: int = 8, def make_grid(
padding: int = 2, normalize: bool = False, tensor: Union[torch.Tensor, Sequence[torch.Tensor]],
range: Optional[Tuple[int, int]] = None, scale_each: bool = False, nrow: int = 8,
pad_value: int = 0) -> torch.Tensor: padding: int = 2,
normalize: bool = False,
range: Optional[Tuple[int, int]] = None,
scale_each: bool = False,
pad_value: int = 0,
) -> torch.Tensor:
"""Make a grid of images. """Make a grid of images.
Args: Args:
...@@ -93,9 +98,17 @@ def make_grid(tensor: Union[torch.Tensor, Sequence[torch.Tensor]], nrow: int = 8 ...@@ -93,9 +98,17 @@ def make_grid(tensor: Union[torch.Tensor, Sequence[torch.Tensor]], nrow: int = 8
return grid return grid
def save_image(tensor: Union[torch.Tensor, Sequence[torch.Tensor]], fp: Union[Text, pathlib.Path, BinaryIO], def save_image(
nrow: int = 8, padding: int = 2, normalize: bool = False, range: Optional[Tuple[int, int]] = None, tensor: Union[torch.Tensor, Sequence[torch.Tensor]],
scale_each: bool = False, pad_value: int = 0, format: Optional[str] = None) -> None: fp: Union[Text, pathlib.Path, BinaryIO],
nrow: int = 8,
padding: int = 2,
normalize: bool = False,
range: Optional[Tuple[int, int]] = None,
scale_each: bool = False,
pad_value: int = 0,
format: Optional[str] = None,
) -> None:
"""Save a given Tensor into an image file. """Save a given Tensor into an image file.
Args: Args:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment