Backends/SiaNet.Backend.MxNet/NDArrayOps.cs
/// <summary>
/// Computes the square sum of array elements over a given axisfor row-sparse matrix. This is a temporary solution for fusing ops square andsum together for row-sparse matrix to save memory for storing gradients.It will become deprecated once the functionality of fusing operators is finishedin the future.Example::  dns = mx.nd.array([[0, 0], [1, 2], [0, 0], [3, 4], [0, 0]])  rsp = dns.tostype('row_sparse')  sum = mx.nd._internal._square_sum(rsp, axis=1)  sum = [0, 5, 0, 25, 0]Defined in G:\deeplearn\mxnet\src\operator\tensor\square_sum.cc:L41
/// </summary>
/// <param name="data">The input</param>
/// <param name="axis">The axis or axes along which to perform the reduction.      The default, `axis=()`, will compute over all elements into a      scalar array with shape `(1,)`.      If `axis` is int, a reduction is performed on a particular axis.      If `axis` is a tuple of ints, a reduction is performed on all the axes      specified in the tuple.      If `exclude` is true, reduction will be performed on the axes that are      NOT in axis instead.      Negative values means indexing from right to left.</param>
/// <param name="keepdims">If this is set to `True`, the reduced axes are left in the result as dimension with size one.</param>
/// <param name="exclude">Whether to perform reduction on axis that are NOT in axis instead.</param>
/// <returns>returns new symbol</returns>
Computes the square sum of array elements over a given axisfor row-sparse matrix.
Computes the square sum of array elements over a given axisfor row - sparse matrix .
public static NDArray SquareSum(NDArray data,
        Shape axis = null,
        bool keepdims = false,
        bool exclude = false)
        {
            return new Operator("_square_sum")
            .SetParam("axis", axis)
            .SetParam("keepdims", keepdims)
            .SetParam("exclude", exclude)
            .SetInput("data", data)
            .Invoke();
        }
public static NDArray SquareSum ( NDArray data , Shape axis = null , bool keepdims = false , bool exclude = false ) { return new Operator ( " " ) . SetParam ( " " , axis ) . SetParam ( " " , keepdims ) . SetParam ( " " , exclude ) . SetInput ( " " , data ) . Invoke ( ) ; }
Computes the square sum of array elements over a given axisfor row-sparse matrix.
Computes the square sum of array elements over a given axisfor row - sparse matrix .
returns new symbol
returns new symbol
data
NDArray
None
axis
Shape
The axis or axes along which to perform the reduction.      The default, `axis=()`, will compute over all elements into a      scalar array with shape `(1,)`.      If `axis` is int, a reduction is performed on a particular axis.      If `axis` is a tuple of ints, a reduction is performed on all the axes      specified in the tuple.      If `exclude` is true, reduction will be performed on the axes that are      NOT in axis instead.      Negative values means indexing from right to left.
The axis or axes along which to perform the reduction . The default ` axis = () ` will compute over all elements into a scalar array with shape ` ( 1 ) ` . If ` axis ` is int a reduction is performed on a particular axis . If ` axis ` is a tuple of ints a reduction is performed on all the axes specified in the tuple . If ` exclude ` is true reduction will be performed on the axes that are NOT in axis instead . Negative values means indexing from right to left .
keepdims
bool
If this is set to `True`, the reduced axes are left in the result as dimension with size one.
If this is set to ` True ` the reduced axes are left in the result as dimension with size one .
exclude
bool
Whether to perform reduction on axis that are NOT in axis instead.
Whether to perform reduction on axis that are NOT in axis instead .