import torch


def averaged_std(outputs):
    """
    Computes averaged standard deviation across list of tensors with the similar size
    Step 1: Std across members of ensemble
    Step 2: Average Across all datapoints
    Step 3: Average Across all item
    """
    #print("Outputs ", outputs)
    outputs = torch.stack(outputs)
    #print("Stacked outputs ", outputs)
    step1 = torch.std(outputs, dim=0)
    step2 = torch.mean(step1, dim=0)
    step3 = torch.mean(step2, dim=0)
    #print("step 3 is ", step3)
    return step3.tolist()