# ResizeLayer

ResizeLayer[{n}]

resizes a matrix of size c0×n0 to be size c0×n.

ResizeLayer[{h,w}]

resizes a tensor of dimensions c0×h0×w0 to be size c0×h×w.

# Details and Options

• ResizeLayer treats the first dimension as a channel dimension, which remains unchanged.
• ResizeLayer performs linear interpolation if there is one remaining dimension and bilinear interpolation if there are two remaining dimensions.
• In ResizeLayer[{d1,,dn}], any of the di can be one of the following:
•  n scale dimension to be size n Scaled[r] scale dimension to be a ratio r of the original size All leave the dimension unchanged
• ResizeLayer[][input] explicitly computes the output from applying the layer.
• ResizeLayer[][{input1,input2,}] explicitly computes outputs for each of the inputi.
• ResizeLayer is typically used inside NetChain, NetGraph, etc.
• ResizeLayer exposes the following ports for use in NetGraph etc.:
•  "Input" a tensor "Output" a tensor of the same rank as the input
• When it cannot be inferred from other layers in a larger net, the option "Input"{d1,,dn} can be used to fix the input of ResizeLayer to be a tensor of dimensions d1××dn.

# Examples

open allclose all

## Basic Examples(2)

Create a ResizeLayer that resizes a 3-tensor to be of size c×8×8.

 In[1]:=
 Out[1]=

Create a ResizeLayer that resizes a matrix to be of size c×2.

 In[1]:=
 Out[1]=

Apply the layer to an input matrix (where c is 1):

 In[2]:=
 Out[2]=