Backends/SiaNet.Backend.MxNet/NDArrayOps.cs
/// <summary>
/// Pads an input array with a constant or edge values of the array... note:: `Pad` is deprecated. Use `pad` instead... note:: Current implementation only supports 4D and 5D input arrays with padding applied   only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.This operation pads an input array with either a `constant_value` or edge valuesalong each axis of the input array. The amount of padding is specified by `pad_width`.`pad_width` is a tuple of integer padding widths for each axis of the format``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``where ``N`` is the number of dimensions of the array.For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many valuesto add before and after the elements of the array along dimension ``N``.The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,``after_2`` must be 0.Example::   x = [[[[  1.   2.   3.]          [  4.   5.   6.]]         [[  7.   8.   9.]          [ 10.  11.  12.]]]        [[[ 11.  12.  13.]          [ 14.  15.  16.]]         [[ 17.  18.  19.]          [ 20.  21.  22.]]]]   pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =         [[[[  1.   1.   2.   3.   3.]            [  1.   1.   2.   3.   3.]            [  4.   4.   5.   6.   6.]            [  4.   4.   5.   6.   6.]]           [[  7.   7.   8.   9.   9.]            [  7.   7.   8.   9.   9.]            [ 10.  10.  11.  12.  12.]            [ 10.  10.  11.  12.  12.]]]          [[[ 11.  11.  12.  13.  13.]            [ 11.  11.  12.  13.  13.]            [ 14.  14.  15.  16.  16.]            [ 14.  14.  15.  16.  16.]]           [[ 17.  17.  18.  19.  19.]            [ 17.  17.  18.  19.  19.]            [ 20.  20.  21.  22.  22.]            [ 20.  20.  21.  22.  22.]]]]   pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =         [[[[  0.   0.   0.   0.   0.]            [  0.   1.   2.   3.   0.]            [  0.   4.   5.   6.   0.]            [  0.   0.   0.   0.   0.]]           [[  0.   0.   0.   0.   0.]            [  0.   7.   8.   9.   0.]            [  0.  10.  11.  12.   0.]            [  0.   0.   0.   0.   0.]]]          [[[  0.   0.   0.   0.   0.]            [  0.  11.  12.  13.   0.]            [  0.  14.  15.  16.   0.]            [  0.   0.   0.   0.   0.]]           [[  0.   0.   0.   0.   0.]            [  0.  17.  18.  19.   0.]            [  0.  20.  21.  22.   0.]            [  0.   0.   0.   0.   0.]]]]Defined in G:\deeplearn\mxnet\src\operator\pad.cc:L765
/// </summary>
/// <param name="data">An n-dimensional input array.</param>
/// <param name="mode">Padding type to use. "constant" pads with `constant_value` "edge" pads using the edge values of the input array "reflect" pads by reflecting values with respect to the edges.</param>
/// <param name="pad_width">Widths of the padding regions applied to the edges of each axis. It is a tuple of integer padding widths for each axis of the format ``(before_1, after_1, ... , before_N, after_N)``. It should be of length ``2*N`` where ``N`` is the number of dimensions of the array.This is equivalent to pad_width in numpy.pad, but flattened.</param>
/// <param name="constant_value">The value used for padding when `mode` is "constant".</param>
/// <returns>returns new symbol</returns>
Pads an input array with a constant or edge values of the array... note:: `Pad` is deprecated. Use `pad` instead... note:: Current implementation only supports 4D and 5D input arrays with padding applied   only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.This operation pads an input array with either a `constant_value` or edge valuesalong each axis of the input array.
Pads an input array with a constant or edge values of the array ... note :: ` Pad ` is deprecated . Use ` pad ` instead ... note :: Current implementation only supports 4D and 5D input arrays with padding applied only on axes 1 2 and 3 . Expects axes 4 and 5 in ` pad_width ` to be zero . This operation pads an input array with either a ` constant_value ` or edge valuesalong each axis of the input array .
public static NDArray Pad(NDArray data,
        PadMode mode,
        Shape pad_width,
        double constant_value = 0)
        {
            return new Operator("Pad")
            .SetParam("mode", NDUtil.EnumToString<PadMode>(mode, PadModeConvert))
            .SetParam("pad_width", pad_width)
            .SetParam("constant_value", constant_value)
            .SetInput("data", data)
            .Invoke();
        }
public static NDArray Pad ( NDArray data , PadMode mode , Shape pad_width , double constant_value = 0 ) { return new Operator ( " " ) . SetParam ( " " , NDUtil . EnumToString < PadMode > ( mode , PadModeConvert ) ) . SetParam ( " " , pad_width ) . SetParam ( " " , constant_value ) . SetInput ( " " , data ) . Invoke ( ) ; }
Pads an input array with a constant or edge values of the array... note:: `Pad` is deprecated.
Pads an input array with a constant or edge values of the array ... note :: ` Pad ` is deprecated .
returns new symbol
returns new symbol
data
NDArray
An n-dimensional input array.
An n - dimensional input array .
mode
PadMode
Padding type to use. "constant" pads with `constant_value` "edge" pads using the edge values of the input array "reflect" pads by reflecting values with respect to the edges.
Padding type to use . " constant " pads with ` constant_value ` " edge " pads using the edge values of the input array " reflect " pads by reflecting values with respect to the edges .
pad_width
Shape
Widths of the padding regions applied to the edges of each axis. It is a tuple of integer padding widths for each axis of the format ``(before_1, after_1, ...
Widths of the padding regions applied to the edges of each axis . It is a tuple of integer padding widths for each axis of the format ` ` ( before_1 after_1 ...
constant_value
double
The value used for padding when `mode` is "constant".
The value used for padding when ` mode ` is " constant " .