upsample_nearest(input: Tensor, size: _Size = None, scale_factor: _Scale = None)Resample input by nearest neighbours (deprecated).
interpolate(input, size, scale_factor, mode='nearest'), which it
calls; it warns on every call, as the reference's does.
Parameters
inputTensorA batch of 1-, 2- or 3-D signals,
(N, C, *spatial).sizeint or tuple of int= NoneThe output's spatial extent; give this or
scale_factor.scale_ factorfloat or tuple of float= NoneHow many times larger the output is along each spatial axis.
Returns
Tensorinput with every pixel repeated to fill the new extent.
Examples
>>> import warnings
>>> import lucid
>>> from lucid.nn.functional import upsample_nearest
>>> with warnings.catch_warnings():
... warnings.simplefilter("ignore")
... y = upsample_nearest(lucid.randn(1, 3, 4, 4), scale_factor=2)
>>> y.shape
(1, 3, 8, 8)