def _is_tfval(v: TfVal) -> bool:
    if isinstance(v, (tf.Tensor, tf.Variable)):
        return True
    try:
        _safe_convert_to_tensor(v)
        return True
    except ValueError:
        return False
def _is_tfval(v: TfVal) -> bool:
    if isinstance(v, (tf.Tensor, tf.Variable)):
        return True
    try:
        _safe_convert_to_tensor(v)
        return True
    except ValueError:
        return False