Skip to content
Snippets Groups Projects
Commit be602fe1 authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Fixed PathLike being defined everywhere

parent 62d5bdcb
No related branches found
No related tags found
No related merge requests found
import logging import logging
from pathlib import Path from pathlib import Path
from typing import List, Tuple, Union from typing import List, Tuple
from opentuner import resultsdb from opentuner import resultsdb
from opentuner.resultsdb.models import Configuration, Result, TuningRun from opentuner.resultsdb.models import Configuration, Result, TuningRun
from sqlalchemy.orm.session import Session from sqlalchemy.orm.session import Session
from sqlalchemy.sql.expression import func from sqlalchemy.sql.expression import func
from ._logging import PathLike
msg_logger = logging.getLogger(__name__) msg_logger = logging.getLogger(__name__)
PathLike = Union[Path, str]
def read_opentuner_db(filepath_or_uri: PathLike) -> List[Tuple[Result, Configuration]]: def read_opentuner_db(filepath_or_uri: PathLike) -> List[Tuple[Result, Configuration]]:
......
import abc import abc
import logging import logging
from pathlib import Path from pathlib import Path
from typing import Dict, Generic, List, Optional, Tuple, Type, TypeVar, Union from typing import Dict, Generic, List, Optional, Tuple, Type, TypeVar
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import numpy as np import numpy as np
from opentuner.measurement.interface import MeasurementInterface from opentuner.measurement.interface import MeasurementInterface
from opentuner.search.manipulator import ConfigurationManipulator, EnumParameter from opentuner.search.manipulator import ConfigurationManipulator, EnumParameter
from ._logging import override_opentuner_config from ._logging import PathLike, override_opentuner_config
from ._pareto import is_pareto_efficient from ._pareto import is_pareto_efficient
msg_logger = logging.getLogger(__name__) msg_logger = logging.getLogger(__name__)
KnobsT = Dict[str, str] KnobsT = Dict[str, str]
PathLike = Union[Path, str]
TunerConfigT = Dict[int, int] TunerConfigT = Dict[int, int]
......
"""Approximation techniques for torch.nn layers.""" """Approximation techniques for torch.nn layers."""
from pathlib import Path from pathlib import Path
from typing import Dict, Iterable, Set, Type, Union from typing import Dict, Iterable, Set, Type
import torch import torch
from torch.nn import Conv2d, Linear, Module, Parameter from torch.nn import Conv2d, Linear, Module, Parameter
from .._logging import PathLike
from ..torchapp import BaselineKnob, TorchApproxKnob from ..torchapp import BaselineKnob, TorchApproxKnob
from ._copy import module_only_deepcopy from ._copy import module_only_deepcopy
PathLike = Union[Path, str]
def _interpolate_first_dim(tensor: torch.Tensor, interp_indices: Iterable[int]): def _interpolate_first_dim(tensor: torch.Tensor, interp_indices: Iterable[int]):
def tensor_at(idx_: int): def tensor_at(idx_: int):
......
...@@ -9,10 +9,10 @@ import numpy as np ...@@ -9,10 +9,10 @@ import numpy as np
import pandas as pd import pandas as pd
import torch import torch
from .approxapp import ApproxApp, ApproxKnob, ApproxTuner, Config, KnobsT from .approxapp import ApproxApp, ApproxTuner, Config, KnobsT
from ._logging import PathLike
msg_logger = logging.getLogger(__name__) msg_logger = logging.getLogger(__name__)
PathLike = Union[Path, str]
class ModeledApp(ApproxApp, abc.ABC): class ModeledApp(ApproxApp, abc.ABC):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment