mirror of
https://github.com/finegrain-ai/refiners.git
synced 2024-11-12 16:18:22 +00:00
pad: add optional padding mode
This commit is contained in:
parent
9b1e25e682
commit
f4298f87d2
|
@ -23,8 +23,8 @@ def manual_seed(seed: int) -> None:
|
|||
_manual_seed(seed)
|
||||
|
||||
|
||||
def pad(x: Tensor, pad: Iterable[int], value: float = 0.0) -> Tensor:
|
||||
return _pad(input=x, pad=pad, value=value) # type: ignore
|
||||
def pad(x: Tensor, pad: Iterable[int], value: float = 0.0, mode: str = "constant") -> Tensor:
|
||||
return _pad(input=x, pad=pad, value=value, mode=mode) # type: ignore
|
||||
|
||||
|
||||
def interpolate(x: Tensor, factor: float | torch.Size, mode: str = "nearest") -> Tensor:
|
||||
|
|
Loading…
Reference in a new issue