Пример #1
0
def test_logger_file():
    logger = logging.get_logger(__name__)

    assert logger.to_file("testing") is None
Пример #2
0
"""Dataset.
"""

from typing import Optional, Tuple

import numpy as np
import tensorflow as tf

import dualing.utils.exception as e
from dualing.utils import logging

logger = logging.get_logger(__name__)


class Dataset:
    """A Dataset class is responsible for receiving raw data, pre-processing it and
    persisting batches that will be feed as inputs to the networks.

    """
    def __init__(
        self,
        batch_size: Optional[int] = 1,
        input_shape: Optional[Tuple[int, ...]] = None,
        normalize: Optional[Tuple[int, int]] = (0, 1),
        shuffle: Optional[bool] = True,
        seed: Optional[int] = 0,
    ):
        """Initialization method.

        Args:
            batch_size: Batch size.
Пример #3
0
def test_get_logger():
    logger = logging.get_logger(__name__)

    assert logger.name == "test_logging"

    assert logger.hasHandlers() is True