-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial code done. Some unit testing in place * All unit tests passing + pre-commit changes * Fixing codeQL issue * Fixing pytest issue * Adding TypeAlias * Removing python 3.8 * Changes based on pre-review w/ Elias * Fixing codeQL issue * Removing type ignore * Fixing comment
- Loading branch information
Showing
5 changed files
with
994 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Copyright 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from dataclasses import dataclass | ||
from enum import Enum, auto | ||
from typing import Any, List, Optional, TypeAlias, Union | ||
|
||
ParameterList: TypeAlias = List[Union[int, str]] | ||
|
||
|
||
class ParameterUsage(Enum): | ||
MODEL = auto() | ||
RUNTIME = auto() | ||
BUILD = auto() | ||
|
||
|
||
class ParameterCategory(Enum): | ||
INTEGER = auto() | ||
EXPONENTIAL = auto() | ||
STR_LIST = auto() | ||
INT_LIST = auto() | ||
|
||
|
||
@dataclass | ||
class SearchParameter: | ||
""" | ||
A dataclass that holds information about a configuration's search parameter | ||
""" | ||
|
||
usage: ParameterUsage | ||
category: ParameterCategory | ||
|
||
# This is only applicable to the LIST categories | ||
enumerated_list: Optional[List[Any]] = None | ||
|
||
# These are only applicable to INTEGER and EXPONENTIAL categories | ||
min_range: Optional[int] = None | ||
max_range: Optional[int] = None |
Oops, something went wrong.