Skip to content

is_available

torch.tvarant.is_available()  bool

Returns whether the Tvarant backend extension is loaded and usable.

Return whether the Tvarant backend extension is usable.

After a successful import torch_tvarant, this is normally True.

Returns:

Name Type Description
bool bool

True if kernels can run on device="tvarant".

Examples:

>>> import torch_tvarant
>>> torch.tvarant.is_available()
True
Source code in torch_tvarant/tvarant/__init__.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
def is_available() -> bool:
    """Return whether the Tvarant backend extension is usable.

    After a successful ``import torch_tvarant``, this is normally ``True``.

    Returns:
        bool: ``True`` if kernels can run on ``device="tvarant"``.

    Examples:
        >>> import torch_tvarant
        >>> torch.tvarant.is_available()
        True
    """
    return bool(_C.is_available())