Backends/SiaNet.Backend.MxNet/NDArrayOps.cs
/// <summary>
/// Generates 2D sampling grid for bilinear sampling.
/// </summary>
/// <param name="@out">output NDArray</param>
/// <param name="data">Input data to the function.</param>
/// <param name="transform_type">The type of transformation. For `affine`, input data should be an affine matrix of size (batch, 6). For `warp`, input data should be an optical flow of size (batch, 2, h, w).</param>
/// <param name="target_shape">Specifies the output shape (H, W). This is required if transformation type is `affine`. If transformation type is `warp`, this parameter is ignored.</param>
/// <returns>returns new symbol</returns>
Generates 2D sampling grid for bilinear sampling.
Generates 2D sampling grid for bilinear sampling .
public static NDArray GridGenerator(NDArray @out,
        NDArray data,
        GridgeneratorTransformType transform_type,
        Shape target_shape = null)
        {
            if (target_shape == null) { target_shape = new Shape(0, 0); }
            return new Operator("GridGenerator")
            .SetParam("transform_type", NDUtil.EnumToString<GridgeneratorTransformType>(transform_type, GridgeneratorTransformTypeConvert))
            .SetParam("target_shape", target_shape)
            .SetInput("data", data)
            .Invoke(@out);
        }
public static NDArray GridGenerator ( NDArray @out , NDArray data , GridgeneratorTransformType transform_type , Shape target_shape = null ) { if ( target_shape == null ) { target_shape = new Shape ( 0 , 0 ) ; } return new Operator ( " " ) . SetParam ( " " , NDUtil . EnumToString < GridgeneratorTransformType > ( transform_type , GridgeneratorTransformTypeConvert ) ) . SetParam ( " " , target_shape ) . SetInput ( " " , data ) . Invoke ( @out ) ; }
Generates 2D sampling grid for bilinear sampling.
Generates 2D sampling grid for bilinear sampling .
returns new symbol
returns new symbol
@out
NDArray
None
data
NDArray
Input data to the function.
Input data to the function .
transform_type
GridgeneratorTransformType
The type of transformation. For `affine`, input data should be an affine matrix of size (batch, 6). For `warp`, input data should be an optical flow of size (batch, 2, h, w).
The type of transformation . For ` affine ` input data should be an affine matrix of size ( batch 6 ) . For ` warp ` input data should be an optical flow of size ( batch 2 h w ) .
target_shape
Shape
Specifies the output shape (H, W). This is required if transformation type is `affine`. If transformation type is `warp`, this parameter is ignored.
Specifies the output shape ( H W ) . This is required if transformation type is ` affine ` . If transformation type is ` warp ` this parameter is ignored .