def xavier_normal_(tensor, gain=1., reverse=False):
    """
    Modify tensor in place using xavier_normal_
    Args:
        tensor (paddle.Tensor): paddle tensor.
        gain (float): super parameter, default to 1.
        reverse (bool):  tensor data format order, default to False.
    Return:
        tensor
    """
    fan_in, fan_out = _calculate_fan_in_and_fan_out(tensor, reverse=reverse)
    std = gain * math.sqrt(2.0 / float(fan_in + fan_out))
    return _no_grad_normal_(tensor, 0, std)

    Modify tensor in place using xavier_normal_
    Args:
        tensor (paddle.Tensor): paddle tensor.
        gain (float): super parameter, default to 1.
        reverse (bool):  tensor data format order, default to False.
    Return:
        tensor
    
contrib/CrossPseudoSupervision/models/initializer.py