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
irange = range
def make_grid(tensor: Union[torch.Tensor, Sequence[torch.Tensor]], nrow: int = 8,
padding: int = 2, normalize: bool = False,
range: Optional[Tuple[int, int]] = None, scale_each: bool = False,
pad_value: int = 0) -> torch.Tensor:
def make_grid(
tensor: Union[torch.Tensor, Sequence[torch.Tensor]],
nrow: int = 8,
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.
Args:
......@@ -93,9 +98,17 @@ def make_grid(tensor: Union[torch.Tensor, Sequence[torch.Tensor]], nrow: int = 8
return grid
def save_image(tensor: Union[torch.Tensor, Sequence[torch.Tensor]], 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:
def save_image(
tensor: Union[torch.Tensor, Sequence[torch.Tensor]],
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.
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