-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50468ac
commit 5de98db
Showing
28 changed files
with
273 additions
and
85 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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
""" | ||
This module contains implementations of _Data **Transporters**_ which are used to handle | ||
how to "transport" the data (e.g., locally, across nodes at a distributed cluster, or | ||
across remote resources). | ||
""" | ||
|
||
from .base import AbstractTransporter, InMemoryTransporter | ||
|
||
__all__ = ["AbstractTransporter", "InMemoryTransporter"] |
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,24 @@ | ||
from __future__ import annotations | ||
|
||
import abc | ||
import typing as t | ||
|
||
|
||
class AbstractTransporter(abc.ABC): | ||
@abc.abstractmethod | ||
def transfer(self, data: t.Any) -> t.Any: | ||
""" | ||
Abstract method to facilitate data transfer. | ||
""" | ||
|
||
|
||
class InMemoryTransporter(AbstractTransporter): | ||
""" | ||
An in-memory transporter that simply returns the data as-is. | ||
This class does nothing fancy, it simply returns the data as-is. The need | ||
for this class is that it adheres to the `AbstractTransporter` standard. | ||
""" | ||
|
||
def transfer(self, data: t.Any) -> t.Any: | ||
return data |
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
File renamed without changes.
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,20 @@ | ||
from flight.learning import AbstractModule | ||
from flight.learning.scikit import ScikitModule | ||
from flight.learning.torch import TorchModule | ||
|
||
|
||
def _test_scikit_global_module(): | ||
pass | ||
|
||
|
||
def _test_torch_global_module(): | ||
pass | ||
|
||
|
||
def test_global_module(module: AbstractModule): | ||
if isinstance(module, TorchModule): | ||
_test_torch_global_module() | ||
elif isinstance(module, ScikitModule): | ||
_test_scikit_global_module() | ||
else: | ||
raise ValueError(f"Unsupported module type: {type(module)}") |
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.