def to_img(x):
    """Convert vector scaled between -1 & 1, with mean 0 to scaled between 0 & 1, with mean 0.5, 
    followed by putting in size 28x28"""
    x = 0.5 * (x + 1)                             # mean and scaling done
    x = x.view(x.size(0), 28, 28)                 # could have used reshape(but may or may not share storage, view always shares)
    return x