Skip to content
fn

upsample_bilinear

→Tensor
upsample_bilinear(input: Tensor, size: _Size = None, scale_factor: _Scale = None)

Resample a 4-D input bilinearly, with aligned corners (deprecated).

interpolate(input, size, scale_factor, mode='bilinear', align_corners=True), which it calls; it warns on every call, as the reference's does.

Parameters

inputTensor
Images, (N, C, H, W).
sizeint or tuple of int= None
Height and width of the output.
scale_factorfloat or tuple of float= None
Scale of height and width.

Returns

Tensor

(N, C, H_out, W_out), with the corner pixels preserved.

Examples

>>> import warnings
>>> import lucid
>>> from lucid.nn.functional import upsample_bilinear
>>> with warnings.catch_warnings():
...     warnings.simplefilter("ignore")
...     y = upsample_bilinear(lucid.randn(1, 3, 4, 4), scale_factor=2)
>>> y.shape
(1, 3, 8, 8)

Used by 1