Skip to content

Commit fb8d433

Browse files
jacobkahnfacebook-github-bot
authored andcommitted
Back out "deeplearning/projects/flashlight-sequence" (#20)
Summary: Pull Request resolved: #20 Breaks Python packaging: #19 Original commit changeset: 65996e1616d0 Original Phabricator Diff: D53935505 Reviewed By: bwasti Differential Revision: D55274807 fbshipit-source-id: 4229a9a61df64b23bd44fd348ac7fab97109876a
1 parent d0c71a5 commit fb8d433

2 files changed

Lines changed: 33 additions & 2 deletions

File tree

bindings/python/flashlight/lib/sequence/criterion.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,33 @@
66
LICENSE file in the root directory of this source tree.
77
"""
88

9+
from .flashlight_lib_sequence_criterion import (
10+
CpuForceAlignmentCriterion,
11+
CpuFullConnectionCriterion,
12+
CpuViterbiPath,
13+
CriterionScaleMode,
14+
)
15+
916

1017
have_torch = False
1118
try:
19+
import torch
1220

1321
have_torch = True
1422
except ImportError:
1523
pass
1624

1725
if have_torch:
18-
pass
26+
from flashlight.lib.sequence.criterion_torch import (
27+
ASGLoss,
28+
check_tensor,
29+
create_workspace,
30+
FACFunction,
31+
FCCFunction,
32+
get_cuda_stream_as_bytes,
33+
get_data_ptr_as_bytes,
34+
run_backward,
35+
run_direction,
36+
run_forward,
37+
run_get_workspace_size,
38+
)

bindings/python/test/test_import.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111

1212
class ImportTestCase(unittest.TestCase):
1313
def test_import_lib_sequence(self) -> None:
14+
from flashlight.lib.sequence import criterion
15+
from flashlight.lib.sequence.criterion import (
16+
CpuForceAlignmentCriterion,
17+
CpuFullConnectionCriterion,
18+
CpuViterbiPath,
19+
CriterionScaleMode,
20+
)
1421

1522
if os.getenv("USE_CUDA", "OFF").upper() not in [
1623
"OFF",
@@ -19,7 +26,11 @@ def test_import_lib_sequence(self) -> None:
1926
"FALSE",
2027
"N",
2128
]:
22-
pass
29+
from flashlight.lib.sequence.flashlight_lib_sequence_criterion import (
30+
CudaForceAlignmentCriterion,
31+
CudaFullConnectionCriterion,
32+
CudaViterbiPath,
33+
)
2334
else:
2435
logging.info("Flashlight Sequence bindings built without CUDA")
2536

0 commit comments

Comments
 (0)