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
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)
def simple_mean(x, target=utils.CCE): """SimpleMean""" return math.mean(x, axis=[2, 3], keepdims=True, target=target)
def reduce_mean(x, axis, keepdims, target=utils.CCE): """ReduceMean""" return math.mean(x, axis=axis, keepdims=keepdims, target=target)