Ejemplo n.º 1
0
def mul_mean(first_input,
             second_input,
             axis=None,
             keepdims=False,
             target="cce"):
    temp = mul(first_input, second_input, target=target)
    output, _ = mean(temp, axis, keepdims)
    return output
Ejemplo n.º 2
0
def mean_square(inputs, axis=None, keepdims=False, target="cce"):
    """Mean of square value of a tensor, alongside the specified axis.

    Arguments:
        input: A tensor.
        axis: A list of integer. Axes to compute the mean.
        keepdims: A boolean, whether to keep the dimensions or not.
            If `keepdims` is `False`, the rank of the tensor is reduced
            by 1 for each entry in `axis`. If `keepdims` is `True`,
            the reduced dimensions are retained with length 1.

    Returns:
        A tensor with the mean of element-wise square value of `input`.

    Notice: There is some precision problem for the operator and remain to solve
    """
    inputs_square = square(inputs)
    return mean(inputs_square, axis, keepdims, target=target)
Ejemplo n.º 3
0
def simple_mean(x, target=utils.CCE):
    """SimpleMean"""
    return math.mean(x, axis=[2, 3], keepdims=True, target=target)
Ejemplo n.º 4
0
def reduce_mean(x, axis, keepdims, target=utils.CCE):
    """ReduceMean"""
    return math.mean(x, axis=axis, keepdims=keepdims, target=target)