def var_shape(tensor):
    """Get TensorFlow Tensor shape.

    Parameters
    ----------
    tensor : tf.Tensor
        the input tensor

    Returns
    -------
    list of int
        the shape
    """
    out = tensor.get_shape().as_list()
    assert all(isinstance(a, int) for a in out), \
        "shape function assumes that shape is fully known"
    return out