action_size is an integer that  represents the dimension of each action
Do you mean something like that?

logger = logging.getLogger(name)
device = torch.device(“cuda:0” if torch.cuda.is_available() else “cpu”)
logger.info(‘Using device: {}’.format(device))