-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from april-tools/fix_pipeline
Fix pipeline and add test for it
- Loading branch information
Showing
15 changed files
with
344 additions
and
115 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 |
---|---|---|
@@ -1 +1,29 @@ | ||
# TODO: we need to decide what to import here | ||
from typing import Type, Union, cast | ||
|
||
from . import layers as layers | ||
from . import model as model | ||
from . import region_graph as region_graph | ||
from . import reparams as reparams | ||
from . import symbolic as symbolic | ||
from . import utils as utils | ||
|
||
|
||
def set_layer_comp_space(comp_space: Union[Type[utils.ComputationSapce], str]) -> None: | ||
"""Set the global computational space for layers. | ||
Args: | ||
comp_space (Union[Type[utils.ComputationSapce], str]): The computational space to use, can \ | ||
be speficied by either the class or the name. | ||
""" | ||
if isinstance(comp_space, str): | ||
comp_space = utils.ComputationSapce.get_comp_space_by_name(comp_space) | ||
|
||
# Cast: a cast is needed because __final__ may be undefined. | ||
assert cast( | ||
bool, getattr(comp_space, "__final__", False) | ||
), "A usable ComputationSapce must be final." | ||
|
||
layers.Layer.comp_space = comp_space | ||
|
||
|
||
set_layer_comp_space(utils.LogSpace) |
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
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
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
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
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
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
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
Oops, something went wrong.