Pular para conteúdo

Example Code

app()

A sample function that checks if CUDA is available.

This function serves as an example template for checking the availability of CUDA-enabled GPUs in a PyTorch environment.

Prints

A boolean value indicating whether CUDA is available.

Source code in src/main.py
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
def app():
    """
    A sample function that checks if CUDA is available.

    This function serves as an example template for checking
    the availability of CUDA-enabled GPUs in a PyTorch environment.

    Prints:
        A boolean value indicating whether CUDA is available.
    """
    print(torch.cuda.is_available())