This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Função desenvolvida usando Lambda para preparar outras funções para execução futura | |
# É criado uma função previamente montada, ou seja, a função já fica | |
# montada com os parametros definidos. | |
def lambda_function(func, *args, **kwargs): | |
return lambda: func(*args, **kwargs) | |
# Criação da função, recebendo dois parametros obrigatórios e argumentos opcionais. | |
def function(arg1, arg2, *args, **kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cupy as cp | |
print(cp.cuda.is_available()) | |
# Limitando o tamanho de memória a ser usado | |
mempool = cp.get_default_memory_pool() | |
with cp.cuda.Device(0): | |
mempool.set_limit(size=1024**3) # 1GB |