def tof(i, shape):
    """Check whether i is tensor or initialization function; return tensor or initialized tensor;
    
    Parameters
    -------
    i : tensor or function
        Tensor or function to initialize tensor
    shape : list or tuple
        Shape of tensor to initialize
    
    Returns
    -------
    : tensor
        Tensor or initialized tensor
    """
    if callable(i):
        return i(shape)
    else:
        return i